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`,