From b74436761d972b4002ca1879535ce0dcba83134d Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 7 Aug 2024 18:09:18 -0300 Subject: [PATCH 1/3] spring-boot-v2 generator adjusts and cacheable TestContainer --- generators/migration/generator.js | 12 --- generators/spring-boot-v2/generator.js | 21 +++++ generators/spring-boot/generator.js | 76 ++++--------------- .../broker/KafkaConsumer_reactive.kt.ejs | 32 ++++++++ ...inersSpringContextCustomizerFactory.kt.ejs | 5 ++ 5 files changed, 74 insertions(+), 72 deletions(-) create mode 100644 generators/spring-boot/templates/kafka/src/main/kotlin/_package_/broker/KafkaConsumer_reactive.kt.ejs diff --git a/generators/migration/generator.js b/generators/migration/generator.js index 36c8eaaed..f32cf640f 100644 --- a/generators/migration/generator.js +++ b/generators/migration/generator.js @@ -3,18 +3,6 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-applica import { passthrough } from '@yeoman/transform'; export default class extends BaseApplicationGenerator { - get [BaseApplicationGenerator.PREPARING]() { - return this.asPreparingTaskGroup({ - async source({ source }) { - this.delayTask(() => { - source.addApplicationPropertiesContent = () => undefined; - source.addIntegrationTestAnnotation = () => undefined; - source.addTestSpringFactory = () => undefined; - }); - }, - }); - } - get [BaseApplicationGenerator.DEFAULT]() { return this.asDefaultTaskGroup({ async defaultTask() { diff --git a/generators/spring-boot-v2/generator.js b/generators/spring-boot-v2/generator.js index cd616f976..4cd25c952 100644 --- a/generators/spring-boot-v2/generator.js +++ b/generators/spring-boot-v2/generator.js @@ -32,6 +32,27 @@ export default class extends BaseApplicationGenerator { migrateApplicationTask, ignoreSpringBootV3Files({ application }) { application.customizeTemplatePaths.push( + // Adjust feign-client and kafka destinationFile for jhipster 7 paths + file => { + if (!['jhipster:feign-client', 'jhipster:spring-cloud-stream:kafka'].includes(file.namespace)) return file; + const renamedFiles = file => { + for (const fileMap of [ + ['security/oauth2/AuthorizationHeaderUtilTest.', 'client/AuthorizationHeaderUtilTest.'], + ['security/oauth2/AuthorizationHeaderUtil.', 'client/AuthorizationHeaderUtil.'], + ['security/oauth2/OAuthIdpTokenResponseDTO.', 'client/OAuthIdpTokenResponseDTO.'], + ['config/KafkaSseConsumer.', 'broker/KafkaConsumer.'], + ['config/KafkaSseProducer.', 'broker/KafkaProducer.'], + ]) { + // Files renamed in v8 + file = file.replace(...fileMap.reverse()); + } + return file; + }; + return { + ...file, + destinationFile: renamedFiles(file.destinationFile), + }; + }, // ignore files from jhipster:spring-boot file => (file.namespace === 'jhipster:spring-boot' ? undefined : file), file => { diff --git a/generators/spring-boot/generator.js b/generators/spring-boot/generator.js index 0c31d6f00..21ccb90ae 100644 --- a/generators/spring-boot/generator.js +++ b/generators/spring-boot/generator.js @@ -1,4 +1,4 @@ -import { basename, join } from 'path'; +import { join } from 'path'; import { existsSync } from 'fs'; // Use spring-boot as parent due to this context in generators import BaseApplicationGenerator from 'generator-jhipster/generators/base-application'; @@ -53,39 +53,6 @@ export default class extends BaseApplicationGenerator { // Remove package-info.java files file => (file.sourceFile.includes('package-info.java') ? undefined : file), // Kotling blueprint does not implements these files - file => { - const sourceBasename = basename(file.sourceFile); - return [ - '_persistClass_Asserts.java', - '_persistClass_TestSamples.java', - 'AssertUtils.java', - '_entityClass_Repository_r2dbc.java', - 'ElasticsearchExceptionMapper.java', - 'ElasticsearchExceptionMapperTest.java', - 'QuerySyntaxException.java', - '_enumName_.java', - '_persistClass_.java.jhi.jackson_identity_info', - '_entityClass_GatlingTest.java', - '_entityClass_CriteriaTest.java', - - 'AccountResource_skipUserManagement.java', - 'TestAuthenticationResource.java', - 'SpaWebFilter_imperative.java', - 'SpaWebFilterIT_imperative.java', - 'SecurityJwtConfiguration.java', - 'AuthenticationIntegrationTest.java', - 'JwtAuthenticationTestUtils.java', - 'AuthenticationIntegrationTest.java', - 'SecurityInMemoryConfiguration.java', - 'TokenAuthenticationIT.java', - 'CRLFLogConverterTest.java', - 'SpaWebFilterIT_reactive.java', - 'SpaWebFilterTestController_reactive.java', - 'AccountResource_oauth2.java', - ].includes(sourceBasename) - ? undefined - : file; - }, file => { // We don't want to handle spring-boot-v2 templates here if (file.namespace === 'jhipster-kotlin:spring-boot-v2') return file; @@ -113,7 +80,6 @@ export default class extends BaseApplicationGenerator { destinationFile = adjustTestContainersSpringContextCustomizerFactoryFile(destinationFile); } - sourceFile = sourceFile.replace('KafkaConsumer_reactive', 'KafkaConsumer_imperative'); sourceFile = convertToKotlinFile(sourceFile); destinationFile = convertToKotlinFile(destinationFile); } @@ -125,34 +91,17 @@ export default class extends BaseApplicationGenerator { const prefix = ns === 'jhipster:spring-boot' || isCommonFile(sourceFile) ? '' : ns.split(':').pop(); sourceFile = join(prefix, sourceFile); - const resolvedSourceInBlueprint = this.templatePath(sourceFile); - const resolvedSourceFile = existsSync(`${resolvedSourceInBlueprint}.ejs`) - ? resolvedSourceInBlueprint - : javaResolvedSourceFile; + let resolvedSourceFile = this.templatePath(sourceFile); + if (!existsSync(`${resolvedSourceFile}.ejs`)) { + if (resolvedSourceFile.includes('.kt')) { + // Ignore v8 file if it does not exist + return undefined; + } + resolvedSourceFile = javaResolvedSourceFile; + } return { ...file, sourceFile, javaResolvedSourceFile, resolvedSourceFile, destinationFile }; }, - // Adjust feign-client and kafka destinationFile for jhipster 7 paths - file => { - if (!['jhipster:feign-client', 'jhipster:spring-cloud-stream:kafka'].includes(file.namespace)) return file; - const renamedFiles = file => { - for (const fileMap of [ - ['security/oauth2/AuthorizationHeaderUtilTest.', 'client/AuthorizationHeaderUtilTest.'], - ['security/oauth2/AuthorizationHeaderUtil.', 'client/AuthorizationHeaderUtil.'], - ['security/oauth2/OAuthIdpTokenResponseDTO.', 'client/OAuthIdpTokenResponseDTO.'], - ['config/KafkaSseConsumer.', 'broker/KafkaConsumer.'], - ['config/KafkaSseProducer.', 'broker/KafkaProducer.'], - ]) { - // Files renamed in v8 - file = file.replace(...fileMap.reverse()); - } - return file; - }; - return { - ...file, - destinationFile: renamedFiles(file.destinationFile), - }; - }, ); }, }); @@ -160,6 +109,13 @@ export default class extends BaseApplicationGenerator { get [BaseApplicationGenerator.PREPARING]() { return this.asPreparingTaskGroup({ + addApplicationPropertiesNeedles({ source }) { + source.addApplicationPropertiesContent = () => undefined; + source.addApplicationPropertiesProperty = () => undefined; + }, + addSpringIntegrationTest({ source }) { + source.addIntegrationTestAnnotation = () => undefined; + }, blockhound({ application, source }) { source.addAllowBlockingCallsInside = ({ classPath, method }) => { if (!application.reactive) throw new Error('Blockhound is only supported by reactive applications'); diff --git a/generators/spring-boot/templates/kafka/src/main/kotlin/_package_/broker/KafkaConsumer_reactive.kt.ejs b/generators/spring-boot/templates/kafka/src/main/kotlin/_package_/broker/KafkaConsumer_reactive.kt.ejs new file mode 100644 index 000000000..e452c32a9 --- /dev/null +++ b/generators/spring-boot/templates/kafka/src/main/kotlin/_package_/broker/KafkaConsumer_reactive.kt.ejs @@ -0,0 +1,32 @@ +<%# + Copyright 2013-2024 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.config + +import org.springframework.cloud.stream.annotation.Input +import org.springframework.messaging.MessageChannel + +interface KafkaSseConsumer { + + companion object { + const val CHANNELNAME = "binding-in-sse" + } + + @Input(CHANNELNAME) + fun input(): MessageChannel +} diff --git a/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs index c19c0da3b..1fb850831 100644 --- a/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs +++ b/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs @@ -270,4 +270,9 @@ class TestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { } } + override fun hashCode() = TestContainersSpringContextCustomizerFactory::class.java.name.hashCode() + + override fun equals(other: Any?): Boolean { + return this.hashCode() == obj.hashCode(); + } } From fee081c29fa4ed9bc4e6125cc51a1ce6e13a7080 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 7 Aug 2024 19:54:55 -0300 Subject: [PATCH 2/3] add modularized TestContainersSpringContextCustomizerFactory --- generators/spring-boot-v2/generator.js | 21 +- .../__snapshots__/generator.spec.js.snap | 4 +- .../__snapshots__/matrix.spec.js.snap | 242 ++++++++++++------ generators/spring-boot/generator.js | 19 +- ...inersSpringContextCustomizerFactory.kt.ejs | 73 ++++++ ...inersSpringContextCustomizerFactory.kt.ejs | 73 ++++++ ...inersSpringContextCustomizerFactory.kt.ejs | 81 ++++++ ...inersSpringContextCustomizerFactory.kt.ejs | 75 ++++++ ...inersSpringContextCustomizerFactory.kt.ejs | 121 +++++++++ ...inersSpringContextCustomizerFactory.kt.ejs | 161 +----------- test/__snapshots__/app.spec.js.snap | 42 +-- test/__snapshots__/server.spec.js.snap | 10 +- test/utils/expected-files.js | 9 - 13 files changed, 630 insertions(+), 301 deletions(-) create mode 100644 generators/spring-boot/templates/kafka/src/test/kotlin/_package_/config/KafkaTestContainersSpringContextCustomizerFactory.kt.ejs create mode 100644 generators/spring-boot/templates/spring-cache/src/test/kotlin/_package_/config/RedisTestContainersSpringContextCustomizerFactory.kt.ejs create mode 100644 generators/spring-boot/templates/spring-data-cassandra/src/test/kotlin/_package_/config/CassandraTestContainersSpringContextCustomizerFactory.kt.ejs create mode 100644 generators/spring-boot/templates/spring-data-neo4j/src/test/kotlin/_package_/config/Neo4jTestContainersSpringContextCustomizerFactory.kt.ejs create mode 100644 generators/spring-boot/templates/spring-data-relational/src/test/kotlin/_package_/config/SqlTestContainersSpringContextCustomizerFactory.kt.ejs diff --git a/generators/spring-boot-v2/generator.js b/generators/spring-boot-v2/generator.js index 4cd25c952..37c65ff3d 100644 --- a/generators/spring-boot-v2/generator.js +++ b/generators/spring-boot-v2/generator.js @@ -89,22 +89,23 @@ export default class extends BaseApplicationGenerator { return file; } + if (sourceFile.includes('spring.factories')) { + return undefined; + } + if (sourceFile.includes('.java')) { // Kotlint User template does not implements Persistable api. Ignore for now. if (application.user && destinationFile.endsWith('UserCallback.java')) { return undefined; } - // TestContainersSpringContextCustomizerFactory uses a single template for modularized (dbs) and non-modularized (kafka, etc) templates - if (sourceFile.endsWith('TestContainersSpringContextCustomizerFactory.java')) { - // Convert *TestContainersSpringContextCustomizerFactory to TestContainersSpringContextCustomizerFactory - const adjustTestContainersSpringContextCustomizerFactoryFile = filename => - filename.replace( - /(\w*)TestContainersSpringContextCustomizerFactory.java/, - 'TestContainersSpringContextCustomizerFactory.java', - ); - sourceFile = adjustTestContainersSpringContextCustomizerFactoryFile(sourceFile); - destinationFile = adjustTestContainersSpringContextCustomizerFactoryFile(destinationFile); + if ( + sourceFile.endsWith('/TestContainersSpringContextCustomizerFactory.java') && + !application.databaseTypeMongodb && + !application.searchEngineElasticsearch && + !application.databaseTypeCouchbase + ) { + return undefined; } for (const fileMap of [ diff --git a/generators/spring-boot/__snapshots__/generator.spec.js.snap b/generators/spring-boot/__snapshots__/generator.spec.js.snap index 3b953a398..c40a6903f 100644 --- a/generators/spring-boot/__snapshots__/generator.spec.js.snap +++ b/generators/spring-boot/__snapshots__/generator.spec.js.snap @@ -593,10 +593,10 @@ exports[`SubGenerator kotlin of kotlin JHipster blueprint > run > should succeed "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { diff --git a/generators/spring-boot/__snapshots__/matrix.spec.js.snap b/generators/spring-boot/__snapshots__/matrix.spec.js.snap index cafbd091e..54b93bb3f 100644 --- a/generators/spring-boot/__snapshots__/matrix.spec.js.snap +++ b/generators/spring-boot/__snapshots__/matrix.spec.js.snap @@ -533,6 +533,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -545,10 +548,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdEntityTest.kt": { @@ -2204,13 +2207,16 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdEntityTest.kt": { @@ -2986,6 +2992,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/PostgreSqlTestContainer.kt": { "stateCleared": "modified", }, @@ -2995,7 +3004,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdEntityTest.kt": { @@ -3585,6 +3594,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/tech/jhipster/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/tech/jhipster/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/tech/jhipster/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -3594,9 +3606,6 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { - "stateCleared": "modified", - }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { "stateCleared": "modified", }, @@ -4241,6 +4250,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, @@ -4843,6 +4855,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/MongoDbTestContainer.kt": { "stateCleared": "modified", }, @@ -5430,10 +5445,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/tech/jhipster/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/tech/jhipster/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { @@ -6098,7 +6113,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > gatew "src/test/kotlin/tech/jhipster/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { @@ -6637,6 +6652,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/tech/jhipster/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/tech/jhipster/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -6646,9 +6664,6 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { - "stateCleared": "modified", - }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { "stateCleared": "modified", }, @@ -7212,6 +7227,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -7224,10 +7242,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdTest.kt": { @@ -8296,6 +8314,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, @@ -9368,6 +9389,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/MongoDbTestContainer.kt": { "stateCleared": "modified", }, @@ -9856,13 +9880,13 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/tech/jhipster/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { @@ -10365,13 +10389,16 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/cucumber/CucumberIT.kt": { @@ -10946,10 +10973,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { @@ -11644,6 +11671,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/PostgreSqlTestContainer.kt": { "stateCleared": "modified", }, @@ -11653,7 +11683,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdTest.kt": { @@ -12207,6 +12237,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/tech/jhipster/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/tech/jhipster/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -12216,9 +12249,6 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { - "stateCleared": "modified", - }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { "stateCleared": "modified", }, @@ -12818,6 +12848,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -12830,10 +12863,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/config/TestSecurityConfiguration.kt": { @@ -14028,6 +14061,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, @@ -15193,6 +15229,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/MongoDbTestContainer.kt": { "stateCleared": "modified", }, @@ -15744,13 +15783,13 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/tech/jhipster/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { @@ -16334,13 +16373,16 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/config/TestSecurityConfiguration.kt": { @@ -16999,10 +17041,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/tech/jhipster/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { @@ -17733,6 +17775,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/PostgreSqlTestContainer.kt": { "stateCleared": "modified", }, @@ -17742,7 +17787,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > micro "src/test/kotlin/com/mycompany/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/config/TestSecurityConfiguration.kt": { @@ -18365,6 +18410,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/tech/jhipster/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/tech/jhipster/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -18374,9 +18422,6 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { - "stateCleared": "modified", - }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { "stateCleared": "modified", }, @@ -18964,6 +19009,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -18976,10 +19024,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/cucumber/CucumberIT.kt": { @@ -20282,6 +20330,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, @@ -21441,6 +21492,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/MongoDbTestContainer.kt": { "stateCleared": "modified", }, @@ -22049,13 +22103,13 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/tech/jhipster/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { @@ -22666,13 +22720,16 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdTest.kt": { @@ -23343,10 +23400,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { @@ -24080,6 +24137,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/PostgreSqlTestContainer.kt": { "stateCleared": "modified", }, @@ -24089,7 +24149,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdTest.kt": { @@ -24703,6 +24763,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/tech/jhipster/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/tech/jhipster/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -24712,9 +24775,6 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { - "stateCleared": "modified", - }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { "stateCleared": "modified", }, @@ -25368,6 +25428,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -25380,10 +25443,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/config/TestSecurityConfiguration.kt": { @@ -26680,6 +26743,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, @@ -27854,6 +27920,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/MongoDbTestContainer.kt": { "stateCleared": "modified", }, @@ -28426,13 +28495,13 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/tech/jhipster/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { @@ -29028,13 +29097,16 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/config/TestSecurityConfiguration.kt": { @@ -29639,10 +29711,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/TestSecurityConfiguration.kt": { @@ -30394,6 +30466,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/PostgreSqlTestContainer.kt": { "stateCleared": "modified", }, @@ -30403,7 +30478,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/config/TestSecurityConfiguration.kt": { @@ -31014,6 +31089,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/tech/jhipster/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/tech/jhipster/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -31023,9 +31101,6 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { - "stateCleared": "modified", - }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { "stateCleared": "modified", }, @@ -31595,6 +31670,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/CassandraTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/CassandraTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/EmbeddedCassandra.kt": { "stateCleared": "modified", }, @@ -31607,10 +31685,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/cucumber/CucumberIT.kt": { @@ -32793,6 +32871,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, @@ -33928,6 +34009,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/MongoDbTestContainer.kt": { "stateCleared": "modified", }, @@ -34494,13 +34578,13 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/tech/jhipster/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { @@ -35072,13 +35156,16 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/Neo4jTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { + "src/test/kotlin/com/mycompany/config/Neo4jTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SpringBootTestClassOrderer.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdTest.kt": { @@ -35683,10 +35770,10 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/tech/jhipster/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/tech/jhipster/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/tech/jhipster/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/tech/jhipster/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/tech/jhipster/config/WebConfigurerTest.kt": { @@ -36393,6 +36480,9 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/KafkaTestContainer.kt": { "stateCleared": "modified", }, + "src/test/kotlin/com/mycompany/config/KafkaTestContainersSpringContextCustomizerFactory.kt": { + "stateCleared": "modified", + }, "src/test/kotlin/com/mycompany/config/PostgreSqlTestContainer.kt": { "stateCleared": "modified", }, @@ -36402,7 +36492,7 @@ exports[`Matrix test of SubGenerator kotlin of kotlin JHipster blueprint > monol "src/test/kotlin/com/mycompany/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/custom/domain/EntityWithCustomIdTest.kt": { diff --git a/generators/spring-boot/generator.js b/generators/spring-boot/generator.js index 21ccb90ae..8a1dca6d7 100644 --- a/generators/spring-boot/generator.js +++ b/generators/spring-boot/generator.js @@ -68,28 +68,11 @@ export default class extends BaseApplicationGenerator { return undefined; } - // TestContainersSpringContextCustomizerFactory uses a single template for modularized (dbs) and non-modularized (kafka, etc) templates - if (sourceFile.endsWith('TestContainersSpringContextCustomizerFactory.java')) { - // Convert *TestContainersSpringContextCustomizerFactory to TestContainersSpringContextCustomizerFactory - const adjustTestContainersSpringContextCustomizerFactoryFile = filename => - filename.replace( - /(\w*)TestContainersSpringContextCustomizerFactory.java/, - 'TestContainersSpringContextCustomizerFactory.java', - ); - sourceFile = adjustTestContainersSpringContextCustomizerFactoryFile(sourceFile); - destinationFile = adjustTestContainersSpringContextCustomizerFactoryFile(destinationFile); - } - sourceFile = convertToKotlinFile(sourceFile); destinationFile = convertToKotlinFile(destinationFile); } - const isCommonFile = filename => { - const sourceBasename = basename(filename); - return ['TestContainersSpringContextCustomizerFactory.kt'].includes(sourceBasename); - }; - - const prefix = ns === 'jhipster:spring-boot' || isCommonFile(sourceFile) ? '' : ns.split(':').pop(); + const prefix = ns === 'jhipster:spring-boot' ? '' : ns.split(':').pop(); sourceFile = join(prefix, sourceFile); let resolvedSourceFile = this.templatePath(sourceFile); if (!existsSync(`${resolvedSourceFile}.ejs`)) { diff --git a/generators/spring-boot/templates/kafka/src/test/kotlin/_package_/config/KafkaTestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/kafka/src/test/kotlin/_package_/config/KafkaTestContainersSpringContextCustomizerFactory.kt.ejs new file mode 100644 index 000000000..3a7e323c6 --- /dev/null +++ b/generators/spring-boot/templates/kafka/src/test/kotlin/_package_/config/KafkaTestContainersSpringContextCustomizerFactory.kt.ejs @@ -0,0 +1,73 @@ +<%# + Copyright 2013-2024 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License") + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.config + +import java.util.* + +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory +import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry +import org.springframework.core.annotation.AnnotatedElementUtils + +import org.springframework.test.context.ContextConfigurationAttributes +import org.springframework.test.context.ContextCustomizer +import org.springframework.test.context.ContextCustomizerFactory +import org.springframework.beans.factory.support.DefaultListableBeanFactory +import org.springframework.boot.test.util.TestPropertyValues +import org.testcontainers.containers.KafkaContainer + +class KafkaTestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { + + private val log = LoggerFactory.getLogger(KafkaTestContainersSpringContextCustomizerFactory::class.java) + + companion object { + private var kafkaBean: KafkaTestContainer? = null + } + + override fun createContextCustomizer( + testClass: Class<*>, + configAttributes: MutableList + ): ContextCustomizer { + return ContextCustomizer { context, _ -> + val beanFactory = context.beanFactory + var testValues = TestPropertyValues.empty() + val kafkaAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedKafka::class.java) + if (null != kafkaAnnotation) { + log.debug("detected the EmbeddedKafka annotation on class {}", testClass.name) + log.info("Warming up the kafka broker") + if (null == kafkaBean) { + kafkaBean = beanFactory.createBean(KafkaTestContainer::class.java) + beanFactory.registerSingleton(KafkaTestContainer::class.java.name, kafkaBean) + // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(KafkaTestContainer::class.java.name, kafkaBean) + } + kafkaBean?.let { + testValues = testValues.and("spring.cloud.stream.kafka.binder.brokers=" + it.getKafkaContainer().host + ':' + it.getKafkaContainer().getMappedPort(KafkaContainer.KAFKA_PORT)) + } + } + testValues.applyTo(context) + } + } + + override fun hashCode() = KafkaTestContainersSpringContextCustomizerFactory::class.java.name.hashCode() + + override fun equals(other: Any?): Boolean { + return this.hashCode() == other.hashCode(); + } +} diff --git a/generators/spring-boot/templates/spring-cache/src/test/kotlin/_package_/config/RedisTestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/spring-cache/src/test/kotlin/_package_/config/RedisTestContainersSpringContextCustomizerFactory.kt.ejs new file mode 100644 index 000000000..f4e238b38 --- /dev/null +++ b/generators/spring-boot/templates/spring-cache/src/test/kotlin/_package_/config/RedisTestContainersSpringContextCustomizerFactory.kt.ejs @@ -0,0 +1,73 @@ +<%# + Copyright 2013-2024 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License") + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.config + +import java.util.* + +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory +import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry +import org.springframework.core.annotation.AnnotatedElementUtils + +import org.springframework.test.context.ContextConfigurationAttributes +import org.springframework.test.context.ContextCustomizer +import org.springframework.test.context.ContextCustomizerFactory +import org.springframework.beans.factory.support.DefaultListableBeanFactory +import org.springframework.boot.test.util.TestPropertyValues + +class RedisTestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { + + private val log = LoggerFactory.getLogger(RedisTestContainersSpringContextCustomizerFactory::class.java) + + companion object { + private var redisBean: RedisTestContainer? = null + } + + override fun createContextCustomizer( + testClass: Class<*>, + configAttributes: MutableList + ): ContextCustomizer { + return ContextCustomizer { context, _ -> + val beanFactory = context.beanFactory + var testValues = TestPropertyValues.empty() + val redisAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedRedis::class.java) + if (null != redisAnnotation) { + log.debug("detected the EmbeddedRedis annotation on class {}", testClass.name) + log.info("Warming up the redis database") + if (null == redisBean) { + redisBean = beanFactory.createBean(RedisTestContainer::class.java) + beanFactory.registerSingleton(RedisTestContainer::class.java.name, redisBean) + // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(RedisTestContainer::class.java.name, redisBean) + } + redisBean?.let { + testValues = testValues.and("jhipster.cache.redis.server=redis://" + it.getRedisContainer()?.containerIpAddress + ":" + it.getRedisContainer()?.getMappedPort(6379)) + } + } + + testValues.applyTo(context) + } + } + + override fun hashCode() = RedisTestContainersSpringContextCustomizerFactory::class.java.name.hashCode() + + override fun equals(other: Any?): Boolean { + return this.hashCode() == other.hashCode(); + } +} diff --git a/generators/spring-boot/templates/spring-data-cassandra/src/test/kotlin/_package_/config/CassandraTestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/spring-data-cassandra/src/test/kotlin/_package_/config/CassandraTestContainersSpringContextCustomizerFactory.kt.ejs new file mode 100644 index 000000000..bd2d9fb89 --- /dev/null +++ b/generators/spring-boot/templates/spring-data-cassandra/src/test/kotlin/_package_/config/CassandraTestContainersSpringContextCustomizerFactory.kt.ejs @@ -0,0 +1,81 @@ +<%# + Copyright 2013-2024 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License") + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.config + +import java.util.* + +import org.cassandraunit.CQLDataLoader + +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory +import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry +import org.springframework.core.annotation.AnnotatedElementUtils + +import org.springframework.test.context.ContextConfigurationAttributes +import org.springframework.test.context.ContextCustomizer +import org.springframework.test.context.ContextCustomizerFactory +import org.springframework.beans.factory.support.DefaultListableBeanFactory +import org.springframework.boot.test.util.TestPropertyValues +import org.testcontainers.containers.CassandraContainer + +class CassandraTestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { + + private val log = LoggerFactory.getLogger(CassandraTestContainersSpringContextCustomizerFactory::class.java) + + companion object { + private var cassandraBean: CassandraTestContainer? = null + } + + override fun createContextCustomizer( + testClass: Class<*>, + configAttributes: MutableList + ): ContextCustomizer { + return ContextCustomizer { context, _ -> + val beanFactory = context.beanFactory + var testValues = TestPropertyValues.empty() + + val cassandraAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedCassandra::class.java) + if (null != cassandraAnnotation) { + log.debug("detected the EmbeddedCassandra annotation on class {}", testClass.name) + log.info("Warming up the cassandra database") + if (null == cassandraBean) { + cassandraBean = beanFactory.createBean(CassandraTestContainer::class.java) + beanFactory.registerSingleton(CassandraTestContainer::class.java.name, cassandraBean) + // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(CassandraTestContainer::class.java.name, cassandraBean) + } + cassandraBean?.let { + testValues = testValues.and("spring.data.cassandra.port=" + it.getCassandraContainer().getMappedPort(CassandraContainer.CQL_PORT)) + .and("spring.data.cassandra.contact-points=" + it.getCassandraContainer().host) + .and("spring.data.cassandra.keyspace-name=" + CQLDataLoader.DEFAULT_KEYSPACE_NAME) + .and("spring.data.cassandra.local-datacenter=" + it.getCassandraContainer().cluster.metadata.allHosts.iterator().next().datacenter) + .and("spring.data.cassandra.cluster-name=" + it.getCassandraContainer().cluster.metadata.clusterName) + } + } + + testValues.applyTo(context) + } + } + + override fun hashCode() = CassandraTestContainersSpringContextCustomizerFactory::class.java.name.hashCode() + + override fun equals(other: Any?): Boolean { + return this.hashCode() == other.hashCode(); + } +} diff --git a/generators/spring-boot/templates/spring-data-neo4j/src/test/kotlin/_package_/config/Neo4jTestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/spring-data-neo4j/src/test/kotlin/_package_/config/Neo4jTestContainersSpringContextCustomizerFactory.kt.ejs new file mode 100644 index 000000000..46d246513 --- /dev/null +++ b/generators/spring-boot/templates/spring-data-neo4j/src/test/kotlin/_package_/config/Neo4jTestContainersSpringContextCustomizerFactory.kt.ejs @@ -0,0 +1,75 @@ +<%# + Copyright 2013-2024 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License") + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.config + +import java.util.* + +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory +import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry +import org.springframework.core.annotation.AnnotatedElementUtils + +import org.springframework.test.context.ContextConfigurationAttributes +import org.springframework.test.context.ContextCustomizer +import org.springframework.test.context.ContextCustomizerFactory +import org.springframework.beans.factory.support.DefaultListableBeanFactory +import org.springframework.boot.test.util.TestPropertyValues + +class Neo4jTestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { + + private val log = LoggerFactory.getLogger(Neo4jTestContainersSpringContextCustomizerFactory::class.java) + + companion object { + private var neo4jBean: Neo4jTestContainer? = null + } + + override fun createContextCustomizer( + testClass: Class<*>, + configAttributes: MutableList + ): ContextCustomizer { + return ContextCustomizer { context, _ -> + val beanFactory = context.beanFactory + var testValues = TestPropertyValues.empty() + val neo4jAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedNeo4j::class.java) + if (null != neo4jAnnotation) { + log.debug("detected the EmbeddedNeo4j annotation on class {}", testClass.name) + log.info("Warming up the neo4j database") + if (null == neo4jBean) { + neo4jBean = beanFactory.createBean(Neo4jTestContainer::class.java) + beanFactory.registerSingleton(Neo4jTestContainer::class.java.name, neo4jBean) + // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(Neo4jTestContainer::class.java.name, neo4jBean) + } + neo4jBean?.let { + testValues = + testValues.and( + "spring.neo4j.uri=" + it.getNeo4jContainer()?.boltUrl + ) + } + } + testValues.applyTo(context) + } + } + + override fun hashCode() = Neo4jTestContainersSpringContextCustomizerFactory::class.java.name.hashCode() + + override fun equals(other: Any?): Boolean { + return this.hashCode() == other.hashCode(); + } +} diff --git a/generators/spring-boot/templates/spring-data-relational/src/test/kotlin/_package_/config/SqlTestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/spring-data-relational/src/test/kotlin/_package_/config/SqlTestContainersSpringContextCustomizerFactory.kt.ejs new file mode 100644 index 000000000..cf99c4683 --- /dev/null +++ b/generators/spring-boot/templates/spring-data-relational/src/test/kotlin/_package_/config/SqlTestContainersSpringContextCustomizerFactory.kt.ejs @@ -0,0 +1,121 @@ +<%# + Copyright 2013-2024 the original author or authors from the JHipster project. + + This file is part of the JHipster project, see https://www.jhipster.tech/ + for more information. + + Licensed under the Apache License, Version 2.0 (the "License") + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-%> +package <%= packageName %>.config + +import java.util.* + +import java.util.Arrays +import tech.jhipster.config.JHipsterConstants + +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory +import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry +import org.springframework.core.annotation.AnnotatedElementUtils + +import org.springframework.test.context.ContextConfigurationAttributes +import org.springframework.test.context.ContextCustomizer +import org.springframework.test.context.ContextCustomizerFactory +import org.springframework.beans.factory.support.DefaultListableBeanFactory +import org.springframework.boot.test.util.TestPropertyValues + +class SqlTestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { + + private val log = LoggerFactory.getLogger(SqlTestContainersSpringContextCustomizerFactory::class.java) + + companion object { +<%_ if (!devDatabaseTypeH2Any) { _%> + private var devTestContainer: SqlTestContainer? = null +<%_ } _%> + private var prodTestContainer: SqlTestContainer? = null + } + + override fun createContextCustomizer( + testClass: Class<*>, + configAttributes: MutableList + ): ContextCustomizer { + return ContextCustomizer { context, _ -> + val beanFactory = context.beanFactory + var testValues = TestPropertyValues.empty() + val sqlAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedSQL::class.java) + if (null != sqlAnnotation) { + log.debug("detected the EmbeddedSQL annotation on class {}", testClass.name) + log.info("Warming up the sql database") +<%_ if (!devDatabaseTypeH2Any) { _%> + if (context.environment.activeProfiles.contains("test${JHipsterConstants.SPRING_PROFILE_DEVELOPMENT}")) { + if (null == devTestContainer) { + try { + val containerClass = Class.forName("${javaClass.packageName}.<% if (devDatabaseTypeMysql) { %>Mysql<% } else if (devDatabaseTypeMariadb) { %>Mariadb<% } else if (devDatabaseTypeMssql) { %>MsSql<% } else if (devDatabaseTypePostgres) { %>PostgreSql<% } %>TestContainer") as (Class) + devTestContainer = beanFactory.createBean(containerClass) + beanFactory.registerSingleton(containerClass.name, devTestContainer) + // (beanFactory as DefaultListableBeanFactory).registerDisposableBean(containerClass.name, devTestContainer) + } catch (e: ClassNotFoundException) { + throw RuntimeException(e) + } + } + devTestContainer?.let { + <%_ if (reactive) { _%> + testValues = testValues.and("spring.r2dbc.url=" + it.getTestContainer().jdbcUrl.replace("jdbc", "r2dbc")<% if (devDatabaseTypeMysql) { %>.replace("mysql", "mariadb")<% } else if (devDatabaseTypeMssql) { %>.replace("encrypt=false", "")<% } %> + "<%- prodDatabaseExtraOptions %>") + testValues = testValues.and("spring.r2dbc.username=" + it.getTestContainer().username) + testValues = testValues.and("spring.r2dbc.password=" + it.getTestContainer().password) + testValues = testValues.and("spring.liquibase.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>" ) + <%_ } else { _%> + testValues = testValues.and("spring.datasource.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>") + testValues = testValues.and("spring.datasource.username=" + it.getTestContainer().username) + testValues = testValues.and("spring.datasource.password=" + it.getTestContainer().password) + <%_ } _%> + } + } +<%_ } _%> + if (context.environment.activeProfiles.asList().contains("test${JHipsterConstants.SPRING_PROFILE_PRODUCTION}")) { + if (null == prodTestContainer) { + try { + val containerClass = Class.forName("${javaClass.packageName}.<% if (prodDatabaseTypeMysql) { %>Mysql<% } else if (prodDatabaseTypeMariadb) { %>Mariadb<% } else if (prodDatabaseTypeMssql) { %>MsSql<% } else if (prodDatabaseTypePostgresql) { %>PostgreSql<% } %>TestContainer") as (Class) + prodTestContainer = beanFactory.createBean(containerClass) + beanFactory.registerSingleton(containerClass.name, prodTestContainer) + // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(containerClass.name, prodTestContainer) + } catch (e: ClassNotFoundException) { + throw RuntimeException(e) + } + } + prodTestContainer?.let { +<%_ if (reactive) { _%> + testValues = testValues.and("spring.r2dbc.url=" + it.getTestContainer().jdbcUrl.replace("jdbc", "r2dbc")<% if (prodDatabaseTypeMysql) { %>.replace("mysql", "mariadb")<% } else if (prodDatabaseTypeMssql) { %>.replace("encrypt=false", "")<% } %> + "<%- prodDatabaseExtraOptions %>") + testValues = testValues.and("spring.r2dbc.username=" + it.getTestContainer().username) + testValues = testValues.and("spring.r2dbc.password=" + it.getTestContainer().password) + testValues = testValues.and("spring.liquibase.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>") +<%_ } else { _%> + testValues = testValues.and("spring.datasource.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>") + testValues = testValues.and("spring.datasource.username=" + it.getTestContainer().username) + testValues = testValues.and("spring.datasource.password=" + it.getTestContainer().password) +<%_ } _%> + } + } + } + + testValues.applyTo(context) + } + } + + override fun hashCode() = SqlTestContainersSpringContextCustomizerFactory::class.java.name.hashCode() + + override fun equals(other: Any?): Boolean { + return this.hashCode() == other.hashCode(); + } +} diff --git a/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs b/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs index 1fb850831..6c7107d09 100644 --- a/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs +++ b/generators/spring-boot/templates/src/test/kotlin/_package_/config/TestContainersSpringContextCustomizerFactory.kt.ejs @@ -20,14 +20,6 @@ package <%= packageName %>.config import java.util.* -<%_ if (databaseTypeCassandra) { _%> -import org.cassandraunit.CQLDataLoader -<%_ } _%> -<%_ if (databaseTypeSql) { _%> -import java.util.Arrays -import tech.jhipster.config.JHipsterConstants -<%_ } _%> - import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.beans.factory.config.ConfigurableListableBeanFactory @@ -39,45 +31,21 @@ import org.springframework.test.context.ContextCustomizer import org.springframework.test.context.ContextCustomizerFactory import org.springframework.beans.factory.support.DefaultListableBeanFactory import org.springframework.boot.test.util.TestPropertyValues -<%_ if (databaseTypeCassandra) { _%> -import org.testcontainers.containers.CassandraContainer -<%_ } _%> -<%_ if (messageBrokerKafka) { _%> -import org.testcontainers.containers.KafkaContainer -<%_ } _%> class TestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { private val log = LoggerFactory.getLogger(TestContainersSpringContextCustomizerFactory::class.java) companion object { - <%_ if (cacheProviderRedis) { _%> - private var redisBean: RedisTestContainer? = null - <%_ } _%> - <%_ if (messageBrokerKafka) { _%> - private var kafkaBean: KafkaTestContainer? = null - <%_ } _%> <%_ if (databaseTypeMongodb) { _%> private var mongoDbBean: MongoDbTestContainer? = null <%_ } _%> - <%_ if (databaseTypeCassandra) { _%> - private var cassandraBean: CassandraTestContainer? = null - <%_ } _%> <%_ if (searchEngineElasticsearch) { _%> private var elasticsearchBean: ElasticsearchTestContainer? = null <%_ } _%> <%_ if (databaseTypeCouchbase || searchEngineCouchbase) { _%> private var couchbaseBean: CouchbaseTestContainer? = null <%_ } _%> - <%_ if (databaseTypeNeo4j) { _%> - private var neo4jBean: Neo4jTestContainer? = null - <%_ } _%> - <%_ if (devDatabaseTypeMysql || devDatabaseTypeMariadb || devDatabaseTypeMssql || devDatabaseTypePostgres) { _%> - private var devTestContainer: SqlTestContainer? = null - <%_ } _%> - <%_ if (prodDatabaseTypeMysql || prodDatabaseTypeMariadb || prodDatabaseTypeMssql || prodDatabaseTypePostgresql) { _%> - private var prodTestContainer: SqlTestContainer? = null - <%_ } _%> } override fun createContextCustomizer( @@ -121,133 +89,6 @@ class TestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { } } <%_ } _%> -<%_ if (cacheProviderRedis) { _%> - val redisAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedRedis::class.java) - if (null != redisAnnotation) { - log.debug("detected the EmbeddedRedis annotation on class {}", testClass.name) - log.info("Warming up the redis database") - if (null == redisBean) { - redisBean = beanFactory.createBean(RedisTestContainer::class.java) - beanFactory.registerSingleton(RedisTestContainer::class.java.name, redisBean) - // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(RedisTestContainer::class.java.name, redisBean) - } - redisBean?.let { - testValues = testValues.and("jhipster.cache.redis.server=redis://" + it.getRedisContainer()?.containerIpAddress + ":" + it.getRedisContainer()?.getMappedPort(6379)) - } - } -<%_ } _%> -<%_ if (databaseTypeSql) { _%> - val sqlAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedSQL::class.java) - if (null != sqlAnnotation) { - log.debug("detected the EmbeddedSQL annotation on class {}", testClass.name) - log.info("Warming up the sql database") - <%_ if (devDatabaseTypeMysql || devDatabaseTypeMariadb || devDatabaseTypeMssql || devDatabaseTypePostgres) { _%> - if (context.environment.activeProfiles.contains("test${JHipsterConstants.SPRING_PROFILE_DEVELOPMENT}")) { - if (null == devTestContainer) { - try { - val containerClass = Class.forName("${javaClass.packageName}.<% if (devDatabaseTypeMysql) { %>Mysql<% } else if (devDatabaseTypeMariadb) { %>Mariadb<% } else if (devDatabaseTypeMssql) { %>MsSql<% } else if (devDatabaseTypePostgres) { %>PostgreSql<% } %>TestContainer") as (Class) - devTestContainer = beanFactory.createBean(containerClass) - beanFactory.registerSingleton(containerClass.name, devTestContainer) - // (beanFactory as DefaultListableBeanFactory).registerDisposableBean(containerClass.name, devTestContainer) - } catch (e: ClassNotFoundException) { - throw RuntimeException(e) - } - } - devTestContainer?.let { -<%_ if (reactive) { _%> - testValues = testValues.and("spring.r2dbc.url=" + it.getTestContainer().jdbcUrl.replace("jdbc", "r2dbc")<% if (devDatabaseTypeMysql) { %>.replace("mysql", "mariadb")<% } else if (devDatabaseTypeMssql) { %>.replace("encrypt=false", "")<% } %> + "<%- prodDatabaseExtraOptions %>") - testValues = testValues.and("spring.r2dbc.username=" + it.getTestContainer().username) - testValues = testValues.and("spring.r2dbc.password=" + it.getTestContainer().password) - testValues = testValues.and("spring.liquibase.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>" ) -<%_ } else { _%> - testValues = testValues.and("spring.datasource.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>") - testValues = testValues.and("spring.datasource.username=" + it.getTestContainer().username) - testValues = testValues.and("spring.datasource.password=" + it.getTestContainer().password) -<%_ } _%> - } - } -<%_ } _%> -<%_ if (prodDatabaseTypeMysql || prodDatabaseTypeMariadb || prodDatabaseTypeMssql || prodDatabaseTypePostgresql) { _%> - if (context.environment.activeProfiles.asList().contains("test${JHipsterConstants.SPRING_PROFILE_PRODUCTION}")) { - if (null == prodTestContainer) { - try { - val containerClass = Class.forName("${javaClass.packageName}.<% if (prodDatabaseTypeMysql) { %>Mysql<% } else if (prodDatabaseTypeMariadb) { %>Mariadb<% } else if (prodDatabaseTypeMssql) { %>MsSql<% } else if (prodDatabaseTypePostgresql) { %>PostgreSql<% } %>TestContainer") as (Class) - prodTestContainer = beanFactory.createBean(containerClass) - beanFactory.registerSingleton(containerClass.name, prodTestContainer) - // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(containerClass.name, prodTestContainer) - } catch (e: ClassNotFoundException) { - throw RuntimeException(e) - } - } - prodTestContainer?.let { -<%_ if (reactive) { _%> - testValues = testValues.and("spring.r2dbc.url=" + it.getTestContainer().jdbcUrl.replace("jdbc", "r2dbc")<% if (prodDatabaseTypeMysql) { %>.replace("mysql", "mariadb")<% } else if (prodDatabaseTypeMssql) { %>.replace("encrypt=false", "")<% } %> + "<%- prodDatabaseExtraOptions %>") - testValues = testValues.and("spring.r2dbc.username=" + it.getTestContainer().username) - testValues = testValues.and("spring.r2dbc.password=" + it.getTestContainer().password) - testValues = testValues.and("spring.liquibase.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>") -<%_ } else { _%> - testValues = testValues.and("spring.datasource.url=" + it.getTestContainer().jdbcUrl + "<%- prodDatabaseExtraOptions %>") - testValues = testValues.and("spring.datasource.username=" + it.getTestContainer().username) - testValues = testValues.and("spring.datasource.password=" + it.getTestContainer().password) -<%_ } _%> - } - } -<%_ } _%> - } -<%_ } _%> - -<%_ if (databaseTypeCassandra) { _%> - val cassandraAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedCassandra::class.java) - if (null != cassandraAnnotation) { - log.debug("detected the EmbeddedCassandra annotation on class {}", testClass.name) - log.info("Warming up the cassandra database") - if (null == cassandraBean) { - cassandraBean = beanFactory.createBean(CassandraTestContainer::class.java) - beanFactory.registerSingleton(CassandraTestContainer::class.java.name, cassandraBean) - // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(CassandraTestContainer::class.java.name, cassandraBean) - } - cassandraBean?.let { - testValues = testValues.and("spring.data.cassandra.port=" + it.getCassandraContainer().getMappedPort(CassandraContainer.CQL_PORT)) - .and("spring.data.cassandra.contact-points=" + it.getCassandraContainer().host) - .and("spring.data.cassandra.keyspace-name=" + CQLDataLoader.DEFAULT_KEYSPACE_NAME) - .and("spring.data.cassandra.local-datacenter=" + it.getCassandraContainer().cluster.metadata.allHosts.iterator().next().datacenter) - .and("spring.data.cassandra.cluster-name=" + it.getCassandraContainer().cluster.metadata.clusterName) - } - } -<%_ } _%> -<%_ if (databaseTypeNeo4j) { _%> - val neo4jAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedNeo4j::class.java) - if (null != neo4jAnnotation) { - log.debug("detected the EmbeddedNeo4j annotation on class {}", testClass.name) - log.info("Warming up the neo4j database") - if (null == neo4jBean) { - neo4jBean = beanFactory.createBean(Neo4jTestContainer::class.java) - beanFactory.registerSingleton(Neo4jTestContainer::class.java.name, neo4jBean) - // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(Neo4jTestContainer::class.java.name, neo4jBean) - } - neo4jBean?.let { - testValues = - testValues.and( - "spring.neo4j.uri=" + it.getNeo4jContainer()?.boltUrl - ) - } - } -<%_ } _%> -<%_ if (messageBrokerKafka) { _%> - val kafkaAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedKafka::class.java) - if (null != kafkaAnnotation) { - log.debug("detected the EmbeddedKafka annotation on class {}", testClass.name) - log.info("Warming up the kafka broker") - if (null == kafkaBean) { - kafkaBean = beanFactory.createBean(KafkaTestContainer::class.java) - beanFactory.registerSingleton(KafkaTestContainer::class.java.name, kafkaBean) - // (beanFactory as (DefaultListableBeanFactory)).registerDisposableBean(KafkaTestContainer::class.java.name, kafkaBean) - } - kafkaBean?.let { - testValues = testValues.and("spring.cloud.stream.kafka.binder.brokers=" + it.getKafkaContainer().host + ':' + it.getKafkaContainer().getMappedPort(KafkaContainer.KAFKA_PORT)) - } - } -<%_ } _%> <%_ if (searchEngineElasticsearch) { _%> val elasticsearchAnnotation = AnnotatedElementUtils.findMergedAnnotation(testClass, EmbeddedElasticsearch::class.java) if (null != elasticsearchAnnotation) { @@ -273,6 +114,6 @@ class TestContainersSpringContextCustomizerFactory: ContextCustomizerFactory { override fun hashCode() = TestContainersSpringContextCustomizerFactory::class.java.name.hashCode() override fun equals(other: Any?): Boolean { - return this.hashCode() == obj.hashCode(); + return this.hashCode() == other.hashCode(); } } diff --git a/test/__snapshots__/app.spec.js.snap b/test/__snapshots__/app.spec.js.snap index a1c16dbad..66a5c03ab 100644 --- a/test/__snapshots__/app.spec.js.snap +++ b/test/__snapshots__/app.spec.js.snap @@ -395,10 +395,10 @@ exports[`JHipster generator for App generator > App with skip client > Gradle > "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -847,7 +847,7 @@ exports[`JHipster generator for App generator > App with skip client > Maven > c "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -1763,10 +1763,10 @@ exports[`JHipster generator for App generator > Application with DB option > mar "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -2954,10 +2954,10 @@ exports[`JHipster generator for App generator > Auth options > HTTP session auth "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -3403,10 +3403,10 @@ exports[`JHipster generator for App generator > Auth options > JWT authenticatio "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -3912,10 +3912,10 @@ exports[`JHipster generator for App generator > Default configuration with > Gra "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -4424,10 +4424,10 @@ exports[`JHipster generator for App generator > Default configuration with > Gra "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -4891,10 +4891,10 @@ exports[`JHipster generator for App generator > Default configuration with > Mav "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -5355,10 +5355,10 @@ exports[`JHipster generator for App generator > Default configuration with > ang "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -5819,10 +5819,10 @@ exports[`JHipster generator for App generator > Default configuration with > rea "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -6283,10 +6283,10 @@ exports[`JHipster generator for App generator > Testing options > Cucumber tests "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { diff --git a/test/__snapshots__/server.spec.js.snap b/test/__snapshots__/server.spec.js.snap index 452d3cf3d..f2eb761f5 100644 --- a/test/__snapshots__/server.spec.js.snap +++ b/test/__snapshots__/server.spec.js.snap @@ -1226,10 +1226,10 @@ exports[`JHipster server generator > generate server with caffeine > creates exp "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -2593,10 +2593,10 @@ exports[`JHipster server generator > generate server with ehcache > creates expe "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { @@ -3015,7 +3015,7 @@ exports[`JHipster server generator > microfrontend > should match generated file "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainer.kt": { "stateCleared": "modified", }, - "src/test/kotlin/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt": { + "src/test/kotlin/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.kt": { "stateCleared": "modified", }, "src/test/kotlin/com/mycompany/myapp/config/WebConfigurerTest.kt": { diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js index de3615f3c..cb60379e7 100644 --- a/test/utils/expected-files.js +++ b/test/utils/expected-files.js @@ -83,7 +83,6 @@ const expectedFiles = { `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/web/rest/errors/ExceptionTranslatorTestController.kt`, `${SERVER_TEST_RES_DIR}config/application.yml`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/AsyncSyncConfiguration.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_RES_DIR}META-INF/spring.factories`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, `${SERVER_TEST_RES_DIR}logback.xml`, @@ -130,7 +129,6 @@ const expectedFiles = { `${DOCKER_DIR}redis/Redis-Cluster.Dockerfile`, `${SERVER_TEST_SRC_DIR}/com/mycompany/myapp/config/EmbeddedRedis.kt`, `${SERVER_TEST_SRC_DIR}/com/mycompany/myapp/config/RedisTestContainer.kt`, - `${SERVER_TEST_SRC_DIR}/com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, ], gatling: [`${TEST_DIR}gatling/conf/gatling.conf`], @@ -233,7 +231,6 @@ const expectedFiles = { `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/config/KafkaSseProducer.kt`, `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/JhipsterKafkaResource.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/web/rest/JhipsterKafkaResourceIT.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/KafkaTestContainer.kt`, `${DOCKER_DIR}kafka.yml`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, @@ -275,7 +272,6 @@ const expectedFiles = { mysql: [ `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/SqlTestContainer.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/MysqlTestContainer.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/EmbeddedSQL.kt`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, `${SERVER_TEST_RES_DIR}META-INF/spring.factories`, @@ -286,7 +282,6 @@ const expectedFiles = { mariadb: [ `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/SqlTestContainer.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/MariadbTestContainer.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/EmbeddedSQL.kt`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, `${SERVER_TEST_RES_DIR}META-INF/spring.factories`, @@ -300,7 +295,6 @@ const expectedFiles = { mssql: [ `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/SqlTestContainer.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/MsSqlTestContainer.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/EmbeddedSQL.kt`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, `${SERVER_TEST_RES_DIR}META-INF/spring.factories`, @@ -311,7 +305,6 @@ const expectedFiles = { postgresql: [ `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/SqlTestContainer.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/PostgreSqlTestContainer.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/EmbeddedSQL.kt`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, `${SERVER_TEST_RES_DIR}META-INF/spring.factories`, @@ -356,7 +349,6 @@ const expectedFiles = { neo4j: [ `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/EmbeddedNeo4j.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/Neo4jTestContainer.kt`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_RES_DIR}testcontainers.properties`, `${SERVER_TEST_RES_DIR}META-INF/spring.factories`, `${SERVER_MAIN_RES_DIR}config/neo4j/migrations/user__admin.json`, @@ -372,7 +364,6 @@ const expectedFiles = { `${SERVER_MAIN_RES_DIR}config/cql/drop-keyspace.cql`, `${SERVER_MAIN_RES_DIR}config/cql/changelog/00000000000000_create-tables.cql`, `${SERVER_MAIN_RES_DIR}config/cql/changelog/00000000000001_insert_default_users.cql`, - `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/TestContainersSpringContextCustomizerFactory.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/config/CassandraTestContainer.kt`, `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/CassandraKeyspaceIT.kt`, `${DOCKER_DIR}cassandra/Cassandra-Migration.Dockerfile`, From 7769e972fb418d24c06f01c93d794a202ed322f5 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 7 Aug 2024 21:56:26 -0300 Subject: [PATCH 3/3] add tips --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d7adf3eb..7af2bf812 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,6 +41,11 @@ In the conflict resolution, check diff and press `i` if the template is synchron When synchronization is done revert `.yo-resolve` file to the initial previous state. +Tips: + +- Avoid changing ejs flow control code for a cleaner diff against original java template +- In the confict resolution diff, you can edit the original file and press `r` to recreate the diff. + ### Regular Contributor Guidelines These are some of the guidelines that we would like you to follow if you are a regular contributor to the project