Skip to content

Commit

Permalink
Merge pull request #3378 from DamnClin/merge-bean-validation-test
Browse files Browse the repository at this point in the history
Merge bean validation test in spring boot
  • Loading branch information
pascalgrimaud authored Sep 1, 2022
2 parents 4965b2a + 6bdb9c4 commit 92ec744
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 141 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) {
.addDependency(springBootConfigurationProcessor())
.addDependency(groupId("org.apache.commons"), artifactId("commons-lang3"))
.addDependency(springBootTest())
.addDependency(reflectionsDependency())
.and()
.javaBuildPlugins()
.pluginManagement(springBootPluginManagement())
Expand All @@ -73,6 +74,10 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) {
.add(SOURCE.template("logback.xml"), TEST_RESOURCES_DESTINATION.append("logback.xml"))
.add(SOURCE.template("LogsSpy.java"), toSrcTestJava().append(properties.packagePath()).append("LogsSpy.java"))
.add(SOURCE.template("ApplicationStartupTracesTest.java"), toSrcTestJava().append(packagePath).append("ApplicationStartupTracesTest.java"))
.batch(SOURCE, toSrcTestJava().append(properties.packagePath()))
.addTemplate("BeanValidationAssertions.java")
.addTemplate("BeanValidationTest.java")
.and()
.and()
.optionalReplacements()
.in("pom.xml")
Expand Down Expand Up @@ -107,6 +112,15 @@ private JavaDependency springBootTest() {
.build();
}

private JavaDependency reflectionsDependency() {
return javaDependency()
.groupId("org.reflections")
.artifactId("reflections")
.versionSlug("reflections")
.scope(JavaDependencyScope.TEST)
.build();
}

private JavaBuildPlugin springBootPluginManagement() {
return JavaBuildPlugin
.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ JHipsterModuleResource dummyFeatureModule(DummyApplicationService dummy) {
.addFeatureDependency("web-error-management")
.addFeatureDependency("springdoc")
.addModuleDependency("java-base")
.addModuleDependency("bean-validation-test")
.build()
)
.tags("server")
Expand Down
7 changes: 0 additions & 7 deletions src/test/features/bean-validation-test.feature

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ void shouldBuildModuleOnProjectWithoutDefaultGoal() {
</dependency>
"""
)
.containing(
"""
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>${reflections.version}</version>
<scope>test</scope>
</dependency>
"""
)
.containing(
"""
<plugin>
Expand Down Expand Up @@ -146,6 +156,7 @@ void shouldBuildModuleOnProjectWithoutDefaultGoal() {
"src/main/resources/config/application-local.properties",
"src/test/resources/config/application.properties"
)
.createPrefixedFiles("src/test/java/com/jhipster/test", "BeanValidationAssertions.java", "BeanValidationTest.java")
.createFiles("src/test/resources/logback.xml", "src/main/resources/logback-spring.xml")
.createFiles("documentation/logs-spy.md")
.createJavaTests("com/jhipster/test/LogsSpy.java");
Expand Down
6 changes: 0 additions & 6 deletions tests-ci/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ elif [[ $application == 'fullapp' ]]; then
applyModules "postgresql" "liquibase"

applyModules \
"bean-validation-test" \
"dummy-feature" \
"dummy-jpa-persistence" \
"dummy-liquibase-changelog" \
Expand All @@ -142,7 +141,6 @@ elif [[ $application == 'oauth2app' ]]; then
applyModules \
"spring-boot-cucumber" \
"spring-boot-cucumber-oauth2-authentication" \
"bean-validation-test" \
"dummy-feature"

elif [[ $application == 'mysqlapp' ]]; then
Expand All @@ -156,7 +154,6 @@ elif [[ $application == 'mysqlapp' ]]; then
applyModules "spring-boot-cucumber-jpa-reset"

applyModules \
"bean-validation-test" \
"dummy-feature" \
"dummy-jpa-persistence" \
"dummy-liquibase-changelog" \
Expand Down Expand Up @@ -189,7 +186,6 @@ elif [[ $application == 'flywayapp' ]]; then
applyModules "spring-boot-cucumber-jpa-reset"

applyModules \
"bean-validation-test" \
"dummy-feature" \
"dummy-jpa-persistence" \
"dummy-postgresql-flyway-changelog" \
Expand All @@ -207,7 +203,6 @@ elif [[ $application == 'undertowapp' ]]; then
applyModules "spring-boot-cucumber-jpa-reset"

applyModules \
"bean-validation-test" \
"dummy-feature" \
"dummy-jpa-persistence" \
"dummy-not-postgresql-flyway-changelog" \
Expand Down Expand Up @@ -247,7 +242,6 @@ elif [[ $application == 'mongodbapp' ]]; then
cucumber_with_jwt

applyModules \
"bean-validation-test" \
"dummy-feature" \
"dummy-mongodb-persistence"

Expand Down

0 comments on commit 92ec744

Please sign in to comment.