Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antarus committed Jul 17, 2022
1 parent d7569d3 commit 9883e9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/test/features/sonar.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ Feature: Sonar modules
| baseName | jhipster |
Then I should have files in "."
| sonar-project.properties |
Then I should have files in "documentation"
| sonar.md |

Scenario: Should apply frontend and backend sonar module
When I apply "sonar-java-backend-and-frontend" module to default project with maven file
| packageName | tech.jhipster.chips |
| baseName | jhipster |
Then I should have files in "."
| sonar-project.properties |
Then I should have files in "documentation"
| sonar.md |
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ void shouldBuildBackendModule() {
.containing(
"sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/classes/static/**/*.*, src/main/webapp/app/index.tsx"
)
.notContaining("sonar.testExecutionReportPaths=target/test-results/jest/TESTS-results-sonar.xml");
.notContaining("sonar.testExecutionReportPaths=target/test-results/jest/TESTS-results-sonar.xml")
.and()
.createFile("documentation/sonar.md")
.containing("docker compose -f src/main/docker/sonar.yml up -d");
}

@Test
Expand All @@ -51,7 +54,10 @@ void shouldBuildBackendFrontendModule() {
.containing(
"sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/classes/static/**/*.*, src/main/webapp/app/index.tsx, src/main/webapp/routes/index.svelte"
)
.containing("sonar.testExecutionReportPaths=target/test-results/jest/TESTS-results-sonar.xml");
.containing("sonar.testExecutionReportPaths=target/test-results/jest/TESTS-results-sonar.xml")
.and()
.createFile("documentation/sonar.md")
.containing("docker-compose -f src/main/docker/sonar.yml up -d");
}

private void mockSonarqubeImage() {
Expand Down

0 comments on commit 9883e9e

Please sign in to comment.