Repository: jhipster/jhipster-lite
Pull request #9990 (2024-06-04 20:26:36)

enh(spring-properties): use a TreeMap rather than an HashMap to store properties  
That way properties order is guaranteed and reproducible.


Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactory.java
index 5d7c2d5bf..82f869151 100644
--- a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactory.java
@@ -8,6 +8,7 @@ import tech.jhipster.lite.module.domain.docker.DockerImages;
 import tech.jhipster.lite.module.domain.file.JHipsterSource;
 import tech.jhipster.lite.module.domain.javadependency.JavaDependency;
 import tech.jhipster.lite.module.domain.javadependency.JavaDependencyScope;
+import tech.jhipster.lite.module.domain.javaproperties.PropertyKey;
 import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties;
 import tech.jhipster.lite.shared.error.domain.Assert;
 
@@ -16,6 +17,7 @@ public class CassandraModuleFactory {
   private static final JHipsterSource SOURCE = from("server/springboot/database/cassandra");
   private static final String CASSANDRA_SECONDARY = "wire/cassandra/infrastructure/secondary";
   private static final String DC = "datacenter1";
+  private static final PropertyKey LOCAL_DATACENTER_PROPERTY = propertyKey("spring.cassandra.local-datacenter");
   private final DockerImages dockerImages;
 
   public CassandraModuleFactory(DockerImages dockerImages) {
@@ -57,15 +59,15 @@ public class CassandraModuleFactory {
         .and()
       .springMainProperties()
         .set(propertyKey("spring.cassandra.contact-points"), propertyValue("127.0.0.1"))
-        .set(propertyKey("#spring.cassandra.keyspace-name"), propertyValue("yourKeyspace"))
+        .comment(LOCAL_DATACENTER_PROPERTY, comment("keyspace-name: yourKeyspace"))
         .set(propertyKey("spring.cassandra.port"), propertyValue(9042))
-        .set(propertyKey("spring.cassandra.local-datacenter"), propertyValue(DC))
+        .set(LOCAL_DATACENTER_PROPERTY, propertyValue(DC))
         .set(propertyKey("spring.cassandra.schema-action"), propertyValue("none"))
         .and()
       .springTestProperties()
         .set(propertyKey("spring.cassandra.port"), propertyValue("${TEST_CASSANDRA_PORT}"))
         .set(propertyKey("spring.cassandra.contact-points"), propertyValue("${TEST_CASSANDRA_CONTACT_POINT}"))
-        .set(propertyKey("spring.cassandra.local-datacenter"), propertyValue("${TEST_CASSANDRA_DC}"))
+        .set(LOCAL_DATACENTER_PROPERTY, propertyValue("${TEST_CASSANDRA_DC}"))
         .set(propertyKey("spring.cassandra.keyspace-name"), propertyValue("${TEST_CASSANDRA_KEYSPACE}"))
         .and()
       .springTestFactories()
diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactory.java
index daf8a2135..423cf7c27 100644
--- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactory.java
@@ -67,7 +67,6 @@ public class JwtBasicAuthModuleFactory {
     //@formatter:on
 
     appendProperties(builder.springMainProperties());
-    appendProperties(builder.springTestProperties());
 
     return builder.build();
   }
diff --git a/src/main/java/tech/jhipster/lite/module/domain/javaproperties/JHipsterModuleSpringProperties.java b/src/main/java/tech/jhipster/lite/module/domain/javaproperties/JHipsterModuleSpringProperties.java
index e529d30dd..6975c9a99 100644
--- a/src/main/java/tech/jhipster/lite/module/domain/javaproperties/JHipsterModuleSpringProperties.java
+++ b/src/main/java/tech/jhipster/lite/module/domain/javaproperties/JHipsterModuleSpringProperties.java
@@ -1,7 +1,6 @@
 package tech.jhipster.lite.module.domain.javaproperties;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 import tech.jhipster.lite.module.domain.JHipsterModule.JHipsterModuleBuilder;
 import tech.jhipster.lite.shared.collection.domain.JHipsterCollections;
 import tech.jhipster.lite.shared.error.domain.Assert;
@@ -31,7 +30,7 @@ public final class JHipsterModuleSpringProperties {
   public static final class JHipsterModuleSpringPropertiesBuilder {
 
     private final JHipsterModuleBuilder module;
-    private final Map<PropertyKey, PropertyValue> properties = new HashMap<>();
+    private final Map<PropertyKey, PropertyValue> properties = new TreeMap<>();
     private final Map<PropertyKey, Comment> comments = new HashMap<>();
 
     private JHipsterModuleSpringPropertiesBuilder(JHipsterModuleBuilder module) {
diff --git a/src/main/java/tech/jhipster/lite/module/domain/javaproperties/PropertyKey.java b/src/main/java/tech/jhipster/lite/module/domain/javaproperties/PropertyKey.java
index 3b05aef2e..e3c136bfe 100644
--- a/src/main/java/tech/jhipster/lite/module/domain/javaproperties/PropertyKey.java
+++ b/src/main/java/tech/jhipster/lite/module/domain/javaproperties/PropertyKey.java
@@ -2,7 +2,7 @@ package tech.jhipster.lite.module.domain.javaproperties;
 
 import tech.jhipster.lite.shared.error.domain.Assert;
 
-public record PropertyKey(String key) {
+public record PropertyKey(String key) implements Comparable<PropertyKey> {
   public PropertyKey {
     Assert.notBlank("key", key);
   }
@@ -10,4 +10,9 @@ public record PropertyKey(String key) {
   public String get() {
     return key();
   }
+
+  @Override
+  public int compareTo(PropertyKey other) {
+    return key.compareTo(other.key);
+  }
 }


Test patch:
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/domain/SpringDocAuth0ModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/domain/SpringDocAuth0ModuleFactoryTest.java
index 1f04d2820..b59c0c683 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/domain/SpringDocAuth0ModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/domain/SpringDocAuth0ModuleFactoryTest.java
@@ -30,16 +30,16 @@ class SpringDocAuth0ModuleFactoryTest {
       .containing(
         """
         springdoc:
+          oauth2:
+            authorization-url: https://dev-123456.us.auth0.com/authorize?audience=https://dev-123456.us.auth0.com/api/v2/
           swagger-ui:
             oauth:
+              client-id: my-client-id
+              realm: jhipster
               scopes:
               - openid
               - profile
               - email
-              client-id: my-client-id
-              realm: jhipster
-          oauth2:
-            authorization-url: https://dev-123456.us.auth0.com/authorize?audience=https://dev-123456.us.auth0.com/api/v2/
         """
       );
     //@formatter:on
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/domain/SpringdocModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/domain/SpringdocModuleFactoryTest.java
index 2730fe1a8..e5f720f2f 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/domain/SpringdocModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/domain/SpringdocModuleFactoryTest.java
@@ -54,11 +54,11 @@ class SpringdocModuleFactoryTest {
       .containing(
         """
         springdoc:
+          enable-native-support: true
           swagger-ui:
             operationsSorter: alpha
             tagsSorter: alpha
             tryItOutEnabled: true
-          enable-native-support: true
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/domain/SpringDocOauth2ModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/domain/SpringDocOauth2ModuleFactoryTest.java
index 01c715b10..48fad042a 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/domain/SpringDocOauth2ModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/domain/SpringDocOauth2ModuleFactoryTest.java
@@ -1,6 +1,7 @@
 package tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocoauth.domain;
 
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.assertThatModuleWithFiles;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.pomFile;
 
 import org.junit.jupiter.api.Test;
 import tech.jhipster.lite.TestFileUtils;
@@ -30,12 +31,12 @@ class SpringDocOauth2ModuleFactoryTest {
       .containing(
         """
         springdoc:
+          oauth2:
+            authorization-url: http://localhost:9080/realms/beer/protocol/openid-connect/auth
           swagger-ui:
             oauth:
               client-id: web_app
               realm: beer
-          oauth2:
-            authorization-url: http://localhost:9080/realms/beer/protocol/openid-connect/auth
         """
       )
       .and()
@@ -43,12 +44,12 @@ class SpringDocOauth2ModuleFactoryTest {
       .containing(
         """
         springdoc:
+          oauth2:
+            authorization-url: http://localhost:9080/realms/beer/protocol/openid-connect/auth
           swagger-ui:
             oauth:
               client-id: web_app
               realm: beer
-          oauth2:
-            authorization-url: http://localhost:9080/realms/beer/protocol/openid-connect/auth
         """
       );
     //@formatter:on
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/domain/SpringDocOktaModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/domain/SpringDocOktaModuleFactoryTest.java
index dedda3527..561238092 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/domain/SpringDocOktaModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/domain/SpringDocOktaModuleFactoryTest.java
@@ -30,16 +30,16 @@ class SpringDocOktaModuleFactoryTest {
       .containing(
         """
         springdoc:
+          oauth2:
+            authorization-url: https://dev-123456.okta.com/oauth2/default/v1/authorize?nonce="jhipster"
           swagger-ui:
             oauth:
+              client-id: my-client-id
+              realm: jhipster
               scopes:
               - openid
               - profile
               - email
-              client-id: my-client-id
-              realm: jhipster
-          oauth2:
-            authorization-url: https://dev-123456.okta.com/oauth2/default/v1/authorize?nonce="jhipster"
         """
       );
     //@formatter:on
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/async/domain/SpringBootAsyncModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/async/domain/SpringBootAsyncModuleFactoryTest.java
index 05f2f3824..97a1d742d 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/async/domain/SpringBootAsyncModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/async/domain/SpringBootAsyncModuleFactoryTest.java
@@ -30,16 +30,16 @@ class SpringBootAsyncModuleFactoryTest {
         """
         spring:
           task:
-            scheduling:
-              thread-name-prefix: myapp-scheduling-
-              pool:
-                size: 2
             execution:
               pool:
                 keep-alive: 10s
-                queue-capacity: 100
                 max-size: 16
+                queue-capacity: 100
               thread-name-prefix: myapp-task-
+            scheduling:
+              pool:
+                size: 2
+              thread-name-prefix: myapp-scheduling-
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/domain/KafkaModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/domain/KafkaModuleFactoryTest.java
index a5bc8caf9..f14b0e937 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/domain/KafkaModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/domain/KafkaModuleFactoryTest.java
@@ -58,17 +58,17 @@ class KafkaModuleFactoryTest {
       .containing(
         """
         kafka:
-          producer:
-            '[key.serializer]': org.apache.kafka.common.serialization.StringSerializer
-            '[value.serializer]': org.apache.kafka.common.serialization.StringSerializer
           bootstrap-servers: localhost:9092
           consumer:
-            '[value.deserializer]': org.apache.kafka.common.serialization.StringDeserializer
             '[auto.offset.reset]': earliest
-            '[key.deserializer]': org.apache.kafka.common.serialization.StringDeserializer
             '[group.id]': myapp
+            '[key.deserializer]': org.apache.kafka.common.serialization.StringDeserializer
+            '[value.deserializer]': org.apache.kafka.common.serialization.StringDeserializer
           polling:
             timeout: 10000
+          producer:
+            '[key.serializer]': org.apache.kafka.common.serialization.StringSerializer
+            '[value.serializer]': org.apache.kafka.common.serialization.StringSerializer
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/domain/EHCacheModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/domain/EHCacheModulesFactoryTest.java
index 5658449b8..c0d888e57 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/domain/EHCacheModulesFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/domain/EHCacheModulesFactoryTest.java
@@ -34,8 +34,8 @@ class EHCacheModulesFactoryTest {
         application:
           cache:
             ehcache:
-              time-to-live-seconds: 3600
               max-entries: 100
+              time-to-live-seconds: 3600
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/core/domain/SpringBootCoreModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/core/domain/SpringBootCoreModuleFactoryTest.java
index f410aa3f7..fe577f4bc 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/core/domain/SpringBootCoreModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/core/domain/SpringBootCoreModuleFactoryTest.java
@@ -148,17 +148,17 @@ class SpringBootCoreModuleFactoryTest {
         .hasFile("src/main/resources/config/application.yml")
         .containing(
           """
+          logging:
+            level:
+              com:
+                jhipster:
+                  test: INFO
           spring:
             application:
               name: Myapp
             threads:
               virtual:
                 enabled: true
-          logging:
-            level:
-              com:
-                jhipster:
-                  test: INFO
           """
         )
         .and()
@@ -177,11 +177,11 @@ class SpringBootCoreModuleFactoryTest {
         .containing(
           """
           logging:
+            config: classpath:logback.xml
             level:
               com:
                 jhipster:
                   test: 'OFF'
-            config: classpath:logback.xml
           spring:
             main:
               banner-mode: 'off'
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java
index 656be85ef..7f36d9255 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java
@@ -57,9 +57,9 @@ class CustomJHLiteModuleFactoryTest {
         .containing(
           """
           jhlite-hidden-resources:
-            tags: banner
             # Disable the modules and its dependencies by slugs
             slugs: custom-jhlite
+            tags: banner
           server:
             port: 9000
           spring:
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactoryTest.java
index b61ffddb2..a7b274ba8 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/cassandra/domain/CassandraModuleFactoryTest.java
@@ -76,16 +76,15 @@ class CassandraModuleFactoryTest {
       .and()
       .hasFile("src/main/resources/config/application.yml")
       .containing(
+        // language=yaml
         """
         spring:
           cassandra:
-            schema-action: none
-            local-datacenter: datacenter1
             contact-points: 127.0.0.1
+            # keyspace-name: yourKeyspace
+            local-datacenter: datacenter1
             port: 9042
-        '#spring':
-          cassandra:
-            keyspace-name: yourKeyspace
+            schema-action: none
         """
       )
       .and()
@@ -101,13 +100,14 @@ class CassandraModuleFactoryTest {
       .hasFiles("src/test/java/com/jhipster/test/wire/cassandra/infrastructure/secondary/CassandraJSR310DateConvertersTest.java")
       .hasFile("src/test/resources/config/application-test.yml")
       .containing(
+        // language=yaml
         """
         spring:
           cassandra:
-            local-datacenter: ${TEST_CASSANDRA_DC}
-            port: ${TEST_CASSANDRA_PORT}
             contact-points: ${TEST_CASSANDRA_CONTACT_POINT}
             keyspace-name: ${TEST_CASSANDRA_KEYSPACE}
+            local-datacenter: ${TEST_CASSANDRA_DC}
+            port: ${TEST_CASSANDRA_PORT}
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/domain/MariaDBModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/domain/MariaDBModuleFactoryTest.java
index 53f8c49e4..e1ce49384 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/domain/MariaDBModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/domain/MariaDBModuleFactoryTest.java
@@ -66,39 +66,39 @@ class MariaDBModuleFactoryTest {
       .containing(
         """
         spring:
+          data:
+            jpa:
+              repositories:
+                bootstrap-mode: deferred
           datasource:
+            driver-class-name: org.mariadb.jdbc.Driver
             hikari:
-              poolName: Hikari
               auto-commit: false
+              poolName: Hikari
             password: ''
-            driver-class-name: org.mariadb.jdbc.Driver
-            username: root
-            url: jdbc:mariadb://localhost:3306/myapp
             type: com.zaxxer.hikari.HikariDataSource
-          data:
-            jpa:
-              repositories:
-                bootstrap-mode: deferred
+            url: jdbc:mariadb://localhost:3306/myapp
+            username: root
           jpa:
+            hibernate:
+              ddl-auto: none
+              naming:
+                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
+                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
+            open-in-view: false
             properties:
               hibernate:
+                connection:
+                  provider_disables_autocommit: true
+                generate_statistics: false
                 jdbc:
-                  time_zone: UTC
                   batch_size: 25
+                  time_zone: UTC
+                order_inserts: true
+                order_updates: true
                 query:
                   fail_on_pagination_over_collection_fetch: true
                   in_clause_parameter_padding: true
-                generate_statistics: false
-                order_updates: true
-                connection:
-                  provider_disables_autocommit: true
-                order_inserts: true
-            hibernate:
-              ddl-auto: none
-              naming:
-                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
-                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
-            open-in-view: false
         """
       )
       .and()
@@ -108,11 +108,11 @@ class MariaDBModuleFactoryTest {
         spring:
           datasource:
             driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
-            username: myapp
             hikari:
               maximum-pool-size: 2
-            url: jdbc:tc:mariadb:0.0.0:///myapp
             password: ''
+            url: jdbc:tc:mariadb:0.0.0:///myapp
+            username: myapp
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mssql/domain/MsSQLModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mssql/domain/MsSQLModuleFactoryTest.java
index 8f5791030..5e3382fa3 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mssql/domain/MsSQLModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mssql/domain/MsSQLModuleFactoryTest.java
@@ -65,60 +65,63 @@ class MsSQLModuleFactoryTest {
       .and()
       .hasFile("src/main/resources/config/application.yml")
       .containing(
+        // language=yaml
         """
         spring:
+          data:
+            jpa:
+              repositories:
+                bootstrap-mode: deferred
+          datasource:
+            driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+            hikari:
+              auto-commit: false
+              poolName: Hikari
+            password: yourStrong(!)Password
+            type: com.zaxxer.hikari.HikariDataSource
+            url: jdbc:sqlserver://localhost:1433;database=myapp;trustServerCertificate=true
+            username: SA
           jpa:
+            hibernate:
+              ddl-auto: update
+              naming:
+                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
+                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
+            open-in-view: false
             properties:
               hibernate:
+                connection:
+                  provider_disables_autocommit: true
                 criteria:
                   literal_handling_mode: BIND
                 dialect: org.hibernate.dialect.SQLServer2012Dialect
+                format_sql: true
+                generate_statistics: false
                 jdbc:
+                  batch_size: 25
                   fetch_size: 150
                   time_zone: UTC
-                  batch_size: 25
+                order_inserts: true
+                order_updates: true
                 query:
                   fail_on_pagination_over_collection_fetch: true
                   in_clause_parameter_padding: true
-                generate_statistics: false
-                order_updates: true
-                connection:
-                  provider_disables_autocommit: true
-                order_inserts: true
-                format_sql: true
-            hibernate:
-              ddl-auto: update
-              naming:
-                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
-                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
-            open-in-view: false
-          datasource:
-            hikari:
-              poolName: Hikari
-              auto-commit: false
-            password: yourStrong(!)Password
-            driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
-            username: SA
-            url: jdbc:sqlserver://localhost:1433;database=myapp;trustServerCertificate=true
-            type: com.zaxxer.hikari.HikariDataSource
-          data:
-            jpa:
-              repositories:
-                bootstrap-mode: deferred
         """
       )
       .and()
       .hasFile("src/test/resources/config/application-test.yml")
       .containing(
+        // language=yaml
         """
         spring:
           datasource:
             driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
-            username: SA
             hikari:
               maximum-pool-size: 2
+            password: yourStrong(!)Password
             url: jdbc:tc:sqlserver:///;database=myapp;trustServerCertificate=true?TC_TMPFS=/testtmpfs:rw
-            password:"""
+            username: SA
+        """
       );
   }
 
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/domain/MySQLModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/domain/MySQLModuleFactoryTest.java
index f9402a5ef..4a2d0d8fe 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/domain/MySQLModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/domain/MySQLModuleFactoryTest.java
@@ -64,55 +64,57 @@ class MySQLModuleFactoryTest {
       .and()
       .hasFile("src/main/resources/config/application.yml")
       .containing(
+        // language=yaml
         """
         spring:
+          data:
+            jpa:
+              repositories:
+                bootstrap-mode: deferred
           datasource:
+            driver-class-name: com.mysql.cj.jdbc.Driver
             hikari:
-              poolName: Hikari
               auto-commit: false
+              poolName: Hikari
             password: ''
-            driver-class-name: com.mysql.cj.jdbc.Driver
-            username: root
-            url: jdbc:mysql://localhost:3306/myapp
             type: com.zaxxer.hikari.HikariDataSource
-          data:
-            jpa:
-              repositories:
-                bootstrap-mode: deferred
+            url: jdbc:mysql://localhost:3306/myapp
+            username: root
           jpa:
+            hibernate:
+              ddl-auto: none
+              naming:
+                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
+                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
+            open-in-view: false
             properties:
               hibernate:
+                connection:
+                  provider_disables_autocommit: true
+                generate_statistics: false
                 jdbc:
-                  time_zone: UTC
                   batch_size: 25
+                  time_zone: UTC
+                order_inserts: true
+                order_updates: true
                 query:
                   fail_on_pagination_over_collection_fetch: true
                   in_clause_parameter_padding: true
-                generate_statistics: false
-                order_updates: true
-                connection:
-                  provider_disables_autocommit: true
-                order_inserts: true
-            hibernate:
-              ddl-auto: none
-              naming:
-                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
-                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
-            open-in-view: false
         """
       )
       .and()
       .hasFile("src/test/resources/config/application-test.yml")
       .containing(
+        // language=yaml
         """
         spring:
           datasource:
             driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
-            username: myapp
             hikari:
               maximum-pool-size: 2
-            url: jdbc:tc:mysql:0.0.0:///myapp
             password: ''
+            url: jdbc:tc:mysql:0.0.0:///myapp
+            username: myapp
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/neo4j/domain/Neo4jModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/neo4j/domain/Neo4jModuleFactoryTest.java
index 0b54e85cb..11a0d7fb8 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/neo4j/domain/Neo4jModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/neo4j/domain/Neo4jModuleFactoryTest.java
@@ -1,11 +1,7 @@
 package tech.jhipster.lite.generator.server.springboot.database.neo4j.domain;
 
 import static org.mockito.Mockito.when;
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.assertThatModuleWithFiles;
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.logbackFile;
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.pomFile;
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.readmeFile;
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.testLogbackFile;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*;
 
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -83,9 +79,9 @@ class Neo4jModuleFactoryTest {
         """
         spring:
           neo4j:
-            uri: bolt://localhost:7687
             pool:
               metrics-enabled: true
+            uri: bolt://localhost:7687
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/domain/PostgresqlModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/domain/PostgresqlModuleFactoryTest.java
index 3a4458a23..4ddb6b0f4 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/domain/PostgresqlModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/domain/PostgresqlModuleFactoryTest.java
@@ -62,39 +62,39 @@ class PostgresqlModuleFactoryTest {
       .containing(
         """
         spring:
+          data:
+            jpa:
+              repositories:
+                bootstrap-mode: deferred
           datasource:
+            driver-class-name: org.postgresql.Driver
             hikari:
-              poolName: Hikari
               auto-commit: false
+              poolName: Hikari
             password: ''
-            driver-class-name: org.postgresql.Driver
-            username: myapp
-            url: jdbc:postgresql://localhost:5432/myapp
             type: com.zaxxer.hikari.HikariDataSource
-          data:
-            jpa:
-              repositories:
-                bootstrap-mode: deferred
+            url: jdbc:postgresql://localhost:5432/myapp
+            username: myapp
           jpa:
+            hibernate:
+              ddl-auto: none
+              naming:
+                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
+                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
+            open-in-view: false
             properties:
               hibernate:
+                connection:
+                  provider_disables_autocommit: true
+                generate_statistics: false
                 jdbc:
-                  time_zone: UTC
                   batch_size: 25
+                  time_zone: UTC
+                order_inserts: true
+                order_updates: true
                 query:
                   fail_on_pagination_over_collection_fetch: true
                   in_clause_parameter_padding: true
-                generate_statistics: false
-                order_updates: true
-                connection:
-                  provider_disables_autocommit: true
-                order_inserts: true
-            hibernate:
-              ddl-auto: none
-              naming:
-                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
-                physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
-            open-in-view: false
         """
       )
       .and()
@@ -104,11 +104,11 @@ class PostgresqlModuleFactoryTest {
         spring:
           datasource:
             driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
-            username: myapp
             hikari:
               maximum-pool-size: 2
-            url: jdbc:tc:postgresql:0.0.0:///myapp?TC_TMPFS=/testtmpfs:rw
             password: ''
+            url: jdbc:tc:postgresql:0.0.0:///myapp?TC_TMPFS=/testtmpfs:rw
+            username: myapp
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/redis/domain/RedisModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/redis/domain/RedisModuleFactoryTest.java
index 27bbbd3c0..b52fadb69 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/redis/domain/RedisModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/redis/domain/RedisModuleFactoryTest.java
@@ -95,8 +95,8 @@ class RedisModuleFactoryTest {
         spring:
           data:
             redis:
-              url: redis://localhost:6379
               database: 0
+              url: redis://localhost:6379
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/devtools/domain/DevToolsModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/devtools/domain/DevToolsModuleFactoryTest.java
index 021fd5cbd..3e02eb644 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/devtools/domain/DevToolsModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/devtools/domain/DevToolsModuleFactoryTest.java
@@ -1,6 +1,7 @@
 package tech.jhipster.lite.generator.server.springboot.devtools.domain;
 
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.assertThatModuleWithFiles;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.pomFile;
 
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -47,10 +48,10 @@ class DevToolsModuleFactoryTest {
         """
         spring:
           devtools:
-            restart:
-              enabled: false
             livereload:
               enabled: false
+            restart:
+              enabled: false
         """
       )
       .and()
@@ -59,10 +60,10 @@ class DevToolsModuleFactoryTest {
         """
         spring:
           devtools:
-            restart:
-              enabled: true
             livereload:
               enabled: true
+            restart:
+              enabled: true
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/domain/LogstashModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/domain/LogstashModuleFactoryTest.java
index 0a66084d2..e416c1fa2 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/domain/LogstashModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/domain/LogstashModuleFactoryTest.java
@@ -54,11 +54,11 @@ class LogstashModuleFactoryTest {
           logging:
             logstash:
               tcp:
-                shutdown_grace_period: PT1M
                 enabled: false
-                ring-buffer-size: 8192
                 host: localhost
                 port: 5000
+                ring-buffer-size: 8192
+                shutdown_grace_period: PT1M
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactoryTest.java
index 3bf37324f..80c8df0f5 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/domain/JwtBasicAuthModuleFactoryTest.java
@@ -1,6 +1,7 @@
 package tech.jhipster.lite.generator.server.springboot.mvc.security.jwt.domain;
 
-import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.assertThatModuleWithFiles;
+import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.pomFile;
 
 import org.junit.jupiter.api.Test;
 import tech.jhipster.lite.TestFileUtils;
@@ -30,38 +31,18 @@ class JwtBasicAuthModuleFactoryTest {
         """
         application:
           security:
-            remember-me-token-validity: P365D
-            token-validity: P1D
             content-security-policy: 'default-src ''self''; frame-src ''self'' data:; script-src
               ''self'' ''unsafe-inline'' ''unsafe-eval'' https://storage.googleapis.com; style-src
               ''self'' ''unsafe-inline'' https://fonts.googleapis.com; img-src ''self'' data:;
               font-src ''self'' data: https://fonts.gstatic.com;'
-        spring:
-          security:
-            user:
-              roles: ADMIN
-              name: admin
-              password: $2a$12$cRKS9ZURbdJIaRsKDTDUmOrH4.B.2rokv8rrkrQXr2IR2Hkna484O
-        """
-      )
-      .and()
-      .hasFile("src/test/resources/config/application-test.yml")
-      .containing(
-        """
-        application:
-          security:
             remember-me-token-validity: P365D
             token-validity: P1D
-            content-security-policy: 'default-src ''self''; frame-src ''self'' data:; script-src
-              ''self'' ''unsafe-inline'' ''unsafe-eval'' https://storage.googleapis.com; style-src
-              ''self'' ''unsafe-inline'' https://fonts.googleapis.com; img-src ''self'' data:;
-              font-src ''self'' data: https://fonts.gstatic.com;'
         spring:
           security:
             user:
-              roles: ADMIN
               name: admin
               password: $2a$12$cRKS9ZURbdJIaRsKDTDUmOrH4.B.2rokv8rrkrQXr2IR2Hkna484O
+              roles: ADMIN
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/domain/OAuth2ModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/domain/OAuth2ModuleFactoryTest.java
index ff6d2841d..611c213b9 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/domain/OAuth2ModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/domain/OAuth2ModuleFactoryTest.java
@@ -1,6 +1,6 @@
 package tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.core.domain;
 
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.when;
 import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*;
 
 import org.junit.jupiter.api.Test;
@@ -95,6 +95,7 @@ class OAuth2ModuleFactoryTest {
       .and()
       .hasFile("src/main/resources/config/application.yml")
       .containing(
+        // language=yaml
         """
         application:
           security:
@@ -104,29 +105,30 @@ class OAuth2ModuleFactoryTest {
           security:
             oauth2:
               client:
+                provider:
+                  oidc:
+                    issuer-uri: http://localhost:9080/realms/my-test-realm
                 registration:
                   oidc:
-                    client-secret: web_app
                     client-id: web_app
+                    client-secret: web_app
                     scope: openid,profile,email
-                provider:
-                  oidc:
-                    issuer-uri: http://localhost:9080/realms/my-test-realm
         """
       )
       .and()
       .hasFile("src/test/resources/config/application-test.yml")
       .containing(
+        // language=yaml
         """
         spring:
+          main:
+            allow-bean-definition-overriding: true
           security:
             oauth2:
               client:
                 provider:
                   oidc:
                     issuer-uri: http://DO_NOT_CALL:9080/realms/my-test-realm
-          main:
-            allow-bean-definition-overriding: true
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/domain/SpringCloudConfigModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/domain/SpringCloudConfigModuleFactoryTest.java
index fb1ab43e1..60a615353 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/domain/SpringCloudConfigModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/domain/SpringCloudConfigModuleFactoryTest.java
@@ -71,48 +71,48 @@ class SpringCloudConfigModuleFactoryTest {
       .hasFile("src/main/resources/config/bootstrap.yml")
       .containing(
         """
+        jhipster:
+          registry:
+            password: admin
         spring:
+          application:
+            name: myApp
           cloud:
+            compatibility-verifier:
+              enabled: false
             config:
+              fail-fast: true
+              label: main
+              name: myApp
               retry:
                 initial-interval: 1000
                 max-attempts: 100
                 max-interval: 2000
-              name: myApp
-              label: main
               uri: http://admin:${jhipster.registry.password}@localhost:8761/config
-              fail-fast: true
-            compatibility-verifier:
-              enabled: false
-          application:
-            name: myApp
-        jhipster:
-          registry:
-            password: admin
         """
       )
       .and()
       .hasFile("src/main/resources/config/bootstrap-local.yml")
       .containing(
         """
+        jhipster:
+          registry:
+            password: admin
         spring:
+          application:
+            name: myApp
           cloud:
+            compatibility-verifier:
+              enabled: false
             config:
+              fail-fast: false
+              label: main
+              name: myApp
               retry:
                 initial-interval: 1000
                 max-attempts: 100
                 max-interval: 2000
-              name: myApp
-              label: main
               uri: http://admin:${jhipster.registry.password}@localhost:8761/config
-              fail-fast: false
-            compatibility-verifier:
-              enabled: false
-          application:
-            name: myApp
-        jhipster:
-          registry:
-            password: admin
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/domain/ConsulModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/domain/ConsulModuleFactoryTest.java
index 4591521a2..37a90fd01 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/domain/ConsulModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/domain/ConsulModuleFactoryTest.java
@@ -85,30 +85,30 @@ class ConsulModuleFactoryTest {
       .containing(
         """
         spring:
+          application:
+            name: burger
           cloud:
+            compatibility-verifier:
+              enabled: false
             consul:
-              port: 8500
+              config:
+                format: yaml
+                profile-separator: '-'
+                watch:
+                  enabled: false
               discovery:
                 health-check-path: ${server.servlet.context-path:}/management/health
-                tags[3]: git-version=${git.build.version:}
+                instance-id: burger:${spring.application.instance-id:${random.value}}
                 prefer-ip-address: true
+                service-name: burger
+                tags[0]: version=@project.version@
+                tags[1]: context-path=${server.servlet.context-path:}
                 tags[2]: profile=${spring.profiles.active:}
-                tags[5]: git-branch=${git.branch:}
+                tags[3]: git-version=${git.build.version:}
                 tags[4]: git-commit=${git.commit.id.abbrev:}
-                tags[1]: context-path=${server.servlet.context-path:}
-                tags[0]: version=@project.version@
-                service-name: burger
-                instance-id: burger:${spring.application.instance-id:${random.value}}
-              config:
-                profile-separator: '-'
-                watch:
-                  enabled: false
-                format: yaml
+                tags[5]: git-branch=${git.branch:}
               host: localhost
-            compatibility-verifier:
-              enabled: false
-          application:
-            name: burger
+              port: 8500
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/domain/EurekaModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/domain/EurekaModuleFactoryTest.java
index 34d7eb1af..5e3eea084 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/domain/EurekaModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/domain/EurekaModuleFactoryTest.java
@@ -74,23 +74,23 @@ class EurekaModuleFactoryTest {
       .containing(
         """
         eureka:
-          instance:
-            health-check-url-path: ${management.endpoints.web.base-path}/health
-            instance-id: myapp:${spring.application.instance-id:${random.value}}
-            status-page-url-path: ${management.endpoints.web.base-path}/info
-            lease-renewal-interval-in-seconds: 5
-            appname: myapp
-            lease-expiration-duration-in-seconds: 10
           client:
-            register-with-eureka: true
-            registry-fetch-interval-seconds: 10
+            enabled: true
+            fetch-registry: true
             healthcheck:
               enabled: true
             instance-info-replication-interval-seconds: 10
+            register-with-eureka: true
+            registry-fetch-interval-seconds: 10
             service-url:
               defaultZone: http://admin:admin@localhost:8761/eureka
-            fetch-registry: true
-            enabled: true
+          instance:
+            appname: myapp
+            health-check-url-path: ${management.endpoints.web.base-path}/health
+            instance-id: myapp:${spring.application.instance-id:${random.value}}
+            lease-expiration-duration-in-seconds: 10
+            lease-renewal-interval-in-seconds: 5
+            status-page-url-path: ${management.endpoints.web.base-path}/info
         spring:
           application:
             name: myApp
@@ -103,15 +103,15 @@ class EurekaModuleFactoryTest {
       .hasFile("src/test/resources/config/bootstrap.yml")
       .containing(
         """
+        eureka:
+          client:
+            enabled: false
         spring:
           application:
             name: myApp
           cloud:
             compatibility-verifier:
               enabled: false
-        eureka:
-          client:
-            enabled: false
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/domain/GatewayModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/domain/GatewayModuleFactoryTest.java
index 58285fd30..345ba7f70 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/domain/GatewayModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/domain/GatewayModuleFactoryTest.java
@@ -57,37 +57,39 @@ class GatewayModuleFactoryTest {
       .and()
       .hasFile("src/main/resources/config/bootstrap.yml")
       .containing(
+        // language=yaml
         """
         spring:
+          application:
+            name: myApp
           cloud:
             gateway:
               discovery:
                 locator:
                   enabled: true
-                  predicates[0]:
-                    name: Path
-                    args[pattern]: '''/services/''+serviceId.toLowerCase()+''/**'''
                   filters[0]:
+                    args[regexp]: '''/services/'' + serviceId.toLowerCase() + ''/(?<remaining>.*)'''
                     args[replacement]: '''/${remaining}'''
                     name: RewritePath
-                    args[regexp]: '''/services/'' + serviceId.toLowerCase() + ''/(?<remaining>.*)'''
                   lower-case-service-id: true
-          application:
-            name: myApp
+                  predicates[0]:
+                    args[pattern]: '''/services/''+serviceId.toLowerCase()+''/**'''
+                    name: Path
         """
       )
       .and()
       .hasFile("src/test/resources/config/bootstrap.yml")
       .containing(
+        // language=yaml
         """
         spring:
+          application:
+            name: myApp
           cloud:
             gateway:
               discovery:
                 locator:
                   enabled: false
-          application:
-            name: myApp
         """
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java
index a39b69970..ef1ab5e98 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java
@@ -32,6 +32,11 @@ class SpringBootActuatorModuleFactoryTest {
       .containing(
         """
         management:
+          endpoint:
+            health:
+              probes:
+                enabled: true
+              show-details: always
           endpoints:
             web:
               base-path: /management
@@ -44,11 +49,6 @@ class SpringBootActuatorModuleFactoryTest {
                 - logfile
                 - loggers
                 - threaddump
-          endpoint:
-            health:
-              probes:
-                enabled: true
-              show-details: always
         """
       );
   }
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/gitinfo/domain/GitInfoModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/gitinfo/domain/GitInfoModuleFactoryTest.java
index 0a2436203..ee645b29a 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/gitinfo/domain/GitInfoModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/gitinfo/domain/GitInfoModuleFactoryTest.java
@@ -44,12 +44,12 @@ class GitInfoModuleFactoryTest {
           """
           management:
             info:
+              env:
+                enabled: true
               # Git Information
               git:
-                mode: full
-                enabled: true
-              env:
                 enabled: true
+                mode: full
           """
         )
         .and()