Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge bean validation test in spring boot #3378

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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