diff --git a/.github/workflows/batch-boot-jpa-sample.yml b/.github/workflows/batch-boot-jpa-sample.yml index 9544f393f..1e2e7b362 100644 --- a/.github/workflows/batch-boot-jpa-sample.yml +++ b/.github/workflows/batch-boot-jpa-sample.yml @@ -22,7 +22,7 @@ jobs: working-directory: batch-boot-jpa-sample strategy: matrix: - distribution: [ 'microsoft' ] + distribution: [ 'temurin' ] java: [ '21' ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/boot-api-archunit-sample.yml b/.github/workflows/boot-api-archunit-sample.yml index 8e275211e..f5e59cfa7 100644 --- a/.github/workflows/boot-api-archunit-sample.yml +++ b/.github/workflows/boot-api-archunit-sample.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build and analyze diff --git a/.github/workflows/boot-choas-monkey.yml b/.github/workflows/boot-choas-monkey.yml index ff68af196..289dcaf17 100644 --- a/.github/workflows/boot-choas-monkey.yml +++ b/.github/workflows/boot-choas-monkey.yml @@ -28,8 +28,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3.13.0 with: - java-version: 17 - distribution: "zulu" + java-version: 21 + distribution: "temurin" cache: "maven" - name: Build and analyze diff --git a/.github/workflows/boot-data-custom-sequences.yml b/.github/workflows/boot-data-custom-sequences.yml index afab0983c..31915ba9e 100644 --- a/.github/workflows/boot-data-custom-sequences.yml +++ b/.github/workflows/boot-data-custom-sequences.yml @@ -28,8 +28,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3.13.0 with: - java-version: 17 - distribution: "zulu" + java-version: 21 + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/boot-data-multipledatasources.yml b/.github/workflows/boot-data-multipledatasources.yml index e2a7e0687..9036ae00e 100644 --- a/.github/workflows/boot-data-multipledatasources.yml +++ b/.github/workflows/boot-data-multipledatasources.yml @@ -28,8 +28,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3.13.0 with: - java-version: 17 - distribution: "zulu" + java-version: 21 + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/boot-jooq-r2dbc-sample.yml b/.github/workflows/boot-jooq-r2dbc-sample.yml index e4c5c6596..90e1feafb 100644 --- a/.github/workflows/boot-jooq-r2dbc-sample.yml +++ b/.github/workflows/boot-jooq-r2dbc-sample.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "zulu" + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/boot-jpa-hibernate2ndlevelcache-sample.yml b/.github/workflows/boot-jpa-hibernate2ndlevelcache-sample.yml index fecb7b89a..51111398f 100644 --- a/.github/workflows/boot-jpa-hibernate2ndlevelcache-sample.yml +++ b/.github/workflows/boot-jpa-hibernate2ndlevelcache-sample.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "zulu" + distribution: "temurin" cache: "maven" - name: Start up redis via Docker Compose run: | diff --git a/.github/workflows/boot-jpa-keyset-pagination.yml b/.github/workflows/boot-jpa-keyset-pagination.yml index 9eba11ea0..d9f9442cf 100644 --- a/.github/workflows/boot-jpa-keyset-pagination.yml +++ b/.github/workflows/boot-jpa-keyset-pagination.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "zulu" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/boot-mongodb-elasticsearch.yml b/.github/workflows/boot-mongodb-elasticsearch.yml index 383866799..9c5050159 100644 --- a/.github/workflows/boot-mongodb-elasticsearch.yml +++ b/.github/workflows/boot-mongodb-elasticsearch.yml @@ -27,8 +27,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3.13.0 with: - java-version: "17" - distribution: "zulu" + java-version: "21" + distribution: "temurin" cache: "maven" - name: Build with Maven run: ./mvnw clean verify diff --git a/.github/workflows/boot-opensearch-sample.yml b/.github/workflows/boot-opensearch-sample.yml index 2fefa6be3..bd0862ba5 100644 --- a/.github/workflows/boot-opensearch-sample.yml +++ b/.github/workflows/boot-opensearch-sample.yml @@ -32,7 +32,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: ${{ matrix.java }} - distribution: 'zulu' + distribution: 'temurin' cache: 'maven' - name: Build with Maven and analyze run: ./mvnw -B clean verify package --file pom.xml diff --git a/.github/workflows/boot-rabbitmq-thymeleaf.yml b/.github/workflows/boot-rabbitmq-thymeleaf.yml index b5513d421..8b9fe23a3 100644 --- a/.github/workflows/boot-rabbitmq-thymeleaf.yml +++ b/.github/workflows/boot-rabbitmq-thymeleaf.yml @@ -32,7 +32,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: ${{ matrix.java }} - distribution: 'zulu' + distribution: 'temurin' cache: 'maven' - name: Build with Maven and analyze run: ./mvnw -B clean verify package --file pom.xml diff --git a/.github/workflows/boot-rest-docs-sample.yml b/.github/workflows/boot-rest-docs-sample.yml index 865550930..3ed6a735f 100644 --- a/.github/workflows/boot-rest-docs-sample.yml +++ b/.github/workflows/boot-rest-docs-sample.yml @@ -33,7 +33,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: ${{ matrix.java }} - distribution: ${{ matrix.distribution }} + distribution: temurin cache: 'maven' - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/boot-togglz-sample.yml b/.github/workflows/boot-togglz-sample.yml index 1bf1ba2c4..50873a28c 100644 --- a/.github/workflows/boot-togglz-sample.yml +++ b/.github/workflows/boot-togglz-sample.yml @@ -28,8 +28,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3.13.0 with: - java-version: 17 - distribution: "zulu" + java-version: 21 + distribution: "temurin" cache: "maven" - name: Build and analyze diff --git a/.github/workflows/boot-ultimate-redis.yml b/.github/workflows/boot-ultimate-redis.yml index c08b80586..3e9711fb8 100644 --- a/.github/workflows/boot-ultimate-redis.yml +++ b/.github/workflows/boot-ultimate-redis.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: "21" - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build with Maven run: ./mvnw clean verify diff --git a/.github/workflows/graphql-boot-querydsl.yml b/.github/workflows/graphql-boot-querydsl.yml index 61949e5a2..825eb8ef4 100644 --- a/.github/workflows/graphql-boot-querydsl.yml +++ b/.github/workflows/graphql-boot-querydsl.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/graphql-boot-webflux.yml b/.github/workflows/graphql-boot-webflux.yml index af9748b85..94ddf8b43 100644 --- a/.github/workflows/graphql-boot-webflux.yml +++ b/.github/workflows/graphql-boot-webflux.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/graphql-boot-webmvc.yml b/.github/workflows/graphql-boot-webmvc.yml index 9cef11de1..c56cd1eeb 100644 --- a/.github/workflows/graphql-boot-webmvc.yml +++ b/.github/workflows/graphql-boot-webmvc.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/httpClients-boot-http-proxy.yml b/.github/workflows/httpClients-boot-http-proxy.yml index ea7d1952c..92427f956 100644 --- a/.github/workflows/httpClients-boot-http-proxy.yml +++ b/.github/workflows/httpClients-boot-http-proxy.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/httpClients-boot-rest-template.yml b/.github/workflows/httpClients-boot-rest-template.yml index 8f55f6c18..b6433561d 100644 --- a/.github/workflows/httpClients-boot-rest-template.yml +++ b/.github/workflows/httpClients-boot-rest-template.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "zulu" + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/httpClients-boot-restClient.yml b/.github/workflows/httpClients-boot-restClient.yml index dc08095fc..45683df10 100644 --- a/.github/workflows/httpClients-boot-restClient.yml +++ b/.github/workflows/httpClients-boot-restClient.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "zulu" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/jpa-boot-data-envers.yml b/.github/workflows/jpa-boot-data-envers.yml index 4b3ef8d37..e29a163c8 100644 --- a/.github/workflows/jpa-boot-data-envers.yml +++ b/.github/workflows/jpa-boot-data-envers.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/jpa-boot-locks.yml b/.github/workflows/jpa-boot-locks.yml index 299f8fe48..b43e96ed9 100644 --- a/.github/workflows/jpa-boot-locks.yml +++ b/.github/workflows/jpa-boot-locks.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/jpa-boot-read-replica-postgresql.yml b/.github/workflows/jpa-boot-read-replica-postgresql.yml index 4104e5df1..52375f6af 100644 --- a/.github/workflows/jpa-boot-read-replica-postgresql.yml +++ b/.github/workflows/jpa-boot-read-replica-postgresql.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Start up databases via docker compose run: | diff --git a/.github/workflows/jpa-multidatasource-multitenancy.yml b/.github/workflows/jpa-multidatasource-multitenancy.yml index 6cfa1c967..df9e04663 100644 --- a/.github/workflows/jpa-multidatasource-multitenancy.yml +++ b/.github/workflows/jpa-multidatasource-multitenancy.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: "21" - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build with Maven run: ./mvnw clean verify diff --git a/.github/workflows/jpa-multitenancy-db.yml b/.github/workflows/jpa-multitenancy-db.yml index 6b6978ff0..bff01366b 100644 --- a/.github/workflows/jpa-multitenancy-db.yml +++ b/.github/workflows/jpa-multitenancy-db.yml @@ -27,8 +27,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3.13.0 with: - java-version: "17" - distribution: "zulu" + java-version: "21" + distribution: "temurin" cache: "maven" - name: Build with Maven run: ./mvnw clean verify diff --git a/.github/workflows/jpa-multitenancy-partition.yml b/.github/workflows/jpa-multitenancy-partition.yml index 46694443c..5a5c7a433 100644 --- a/.github/workflows/jpa-multitenancy-partition.yml +++ b/.github/workflows/jpa-multitenancy-partition.yml @@ -27,8 +27,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3.13.0 with: - java-version: "17" - distribution: "zulu" + java-version: "21" + distribution: "temurin" cache: "maven" - name: Build with Maven run: ./mvnw clean verify diff --git a/.github/workflows/jpa-multitenancy-schema.yml b/.github/workflows/jpa-multitenancy-schema.yml index 44b1390a0..2b1495f2c 100644 --- a/.github/workflows/jpa-multitenancy-schema.yml +++ b/.github/workflows/jpa-multitenancy-schema.yml @@ -27,8 +27,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3.13.0 with: - java-version: "17" - distribution: "zulu" + java-version: "21" + distribution: "temurin" cache: "maven" - name: Build with Maven run: ./mvnw clean verify diff --git a/.github/workflows/open-api-spring-boot.yml b/.github/workflows/open-api-spring-boot.yml index 5d7f894e4..c4badfc6c 100644 --- a/.github/workflows/open-api-spring-boot.yml +++ b/.github/workflows/open-api-spring-boot.yml @@ -28,8 +28,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3.13.0 with: - java-version: 17 - distribution: "zulu" + java-version: 21 + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/r2dbc-boot-sample.yml b/.github/workflows/r2dbc-boot-sample.yml index 858f68592..6cd740485 100644 --- a/.github/workflows/r2dbc-boot-sample.yml +++ b/.github/workflows/r2dbc-boot-sample.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/scheduler-boot-jobrunr.yml b/.github/workflows/scheduler-boot-jobrunr.yml index 2a0ae586c..41abb5b16 100644 --- a/.github/workflows/scheduler-boot-jobrunr.yml +++ b/.github/workflows/scheduler-boot-jobrunr.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/.github/workflows/scheduler-boot-quartz.yml b/.github/workflows/scheduler-boot-quartz.yml index 85a1b00aa..845635772 100644 --- a/.github/workflows/scheduler-boot-quartz.yml +++ b/.github/workflows/scheduler-boot-quartz.yml @@ -29,7 +29,7 @@ jobs: uses: actions/setup-java@v3.13.0 with: java-version: 21 - distribution: "microsoft" + distribution: "temurin" cache: "maven" - name: Grant execute permission for mvnw diff --git a/.github/workflows/spring-boot-httpClients-web-client-webflux.yml b/.github/workflows/spring-boot-httpClients-web-client-webflux.yml index 7136893ce..564b1e8f2 100644 --- a/.github/workflows/spring-boot-httpClients-web-client-webflux.yml +++ b/.github/workflows/spring-boot-httpClients-web-client-webflux.yml @@ -27,8 +27,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3.13.0 with: - java-version: 17 - distribution: "zulu" + java-version: 21 + distribution: "temurin" cache: "maven" - name: Build and analyze run: ./mvnw clean verify diff --git a/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/CustomerControllerIT.java b/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/CustomerControllerIT.java index 60fa78645..e5a4df57d 100644 --- a/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/CustomerControllerIT.java +++ b/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/CustomerControllerIT.java @@ -59,7 +59,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -106,7 +106,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setName("Updated Customer"); this.mockMvc @@ -121,7 +121,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId())) diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CommonRules.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CommonRules.java index ff7ad87ee..2caac37bb 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CommonRules.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CommonRules.java @@ -30,7 +30,7 @@ static ArchRule interfacesAreOnlyAllowedRule(String packageName, String... exclu .resideOutsideOfPackages(excludedPackages) .should() .beInterfaces() - .because(String.format("Resources should be interfaces in %s", packageName)); + .because("Resources should be interfaces in %s".formatted(packageName)); } static ArchRule componentAnnotationIsNotAllowedRule(String packageName) { @@ -39,7 +39,7 @@ static ArchRule componentAnnotationIsNotAllowedRule(String packageName) { .resideInAPackage(packageName) .should() .notBeAnnotatedWith(Component.class) - .because(String.format("Component annotation is not allowed in %s", packageName)); + .because("Component annotation is not allowed in %s".formatted(packageName)); } static ArchRule springAnnotationsClassesAreNotAllowedRule(String... packageNames) { @@ -60,9 +60,8 @@ static ArchRule springAnnotationsClassesAreNotAllowedRule(String... packageNames .notBeAnnotatedWith(Controller.class) .andShould() .notBeAnnotatedWith(RestController.class) - .because(String.format( - "Classes in %s should not be annotated with Spring annotations", - Arrays.toString(packageNames))); + .because("Classes in %s should not be annotated with Spring annotations" + .formatted(Arrays.toString(packageNames))); } // Fields @@ -89,7 +88,7 @@ static ArchRule fieldsShouldNotBePublic(String packageName) { .resideInAPackage(packageName) .should() .notBePublic() - .because(String.format("Public fields are not allowed in %s", packageName)); + .because("Public fields are not allowed in %s".formatted(packageName)); } static ArchRule publicAndFinalFieldsAreNotAllowedRule(String... packageNames) { @@ -102,8 +101,8 @@ static ArchRule publicAndFinalFieldsAreNotAllowedRule(String... packageNames) { .notBeFinal() .andShould() .notBePublic() - .because(String.format( - "Fields with public and final modifiers are not allowed in %s", Arrays.toString(packageNames))); + .because("Fields with public and final modifiers are not allowed in %s" + .formatted(Arrays.toString(packageNames))); } static ArchRule fieldsShouldHaveGetterRule(String... packageNames) { @@ -123,9 +122,8 @@ static ArchRule finalFieldsRule(String packageName, String... excludedPackages) .doNotHaveModifier(JavaModifier.SYNTHETIC) .should() .beFinal() - .because(String.format( - "Private attributes should be instanced by constructor classes, or it should be static in %s", - packageName)); + .because("Private attributes should be instanced by constructor classes, or it should be static in %s" + .formatted(packageName)); } // Constructors @@ -139,7 +137,7 @@ static ArchRule publicConstructorsRule(String packageName) { .areNotAnonymousClasses() .should() .bePublic() - .because(String.format("Public constructors are only allowed in %s", packageName)); + .because("Public constructors are only allowed in %s".formatted(packageName)); } // Methods @@ -150,7 +148,7 @@ static ArchRule beanMethodsAreNotAllowedRule(String packageName) { .resideInAPackage(packageName) .should() .notBeAnnotatedWith(Bean.class) - .because(String.format("Bean methods are not allowed in %s", packageName)); + .because("Bean methods are not allowed in %s".formatted(packageName)); } static ArchRule privateMethodsAreNotAllowedRule(String packageName) { @@ -160,7 +158,7 @@ static ArchRule privateMethodsAreNotAllowedRule(String packageName) { .resideInAPackage(packageName) .should() .notBePrivate() - .because(String.format("Private methods are not allowed in %s", packageName)); + .because("Private methods are not allowed in %s".formatted(packageName)); } static ArchRule staticMethodsAreNotAllowedRule(String packageName) { @@ -170,7 +168,7 @@ static ArchRule staticMethodsAreNotAllowedRule(String packageName) { .resideInAPackage(packageName) .should() .notBeStatic() - .because(String.format("Static methods are not allowed in %s", packageName)); + .because("Static methods are not allowed in %s".formatted(packageName)); } static ArchRule methodsShouldBePublicRule(String... packageNames) { @@ -190,6 +188,6 @@ static ArchRule staticMethodsAreOnlyAllowedRule(String packageName) { .resideInAPackage(packageName) .should() .beStatic() - .because(String.format("Static methods are only allowed in %s", packageName)); + .because("Static methods are only allowed in %s".formatted(packageName)); } } diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ControllerRulesTest.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ControllerRulesTest.java index 6e3076b33..a0c8dedee 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ControllerRulesTest.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ControllerRulesTest.java @@ -41,7 +41,7 @@ class ControllerRulesTest { .beAnnotatedWith(RestController.class) .andShould() .notBeAnnotatedWith(Controller.class) - .because(String.format(ANNOTATED_EXPLANATION, CONTROLLER_SUFFIX, "@RestController") + .because(ANNOTATED_EXPLANATION.formatted(CONTROLLER_SUFFIX, "@RestController") + ", and not with @Controller"); // Fields diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CustomConditions.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CustomConditions.java index 60fa71ecc..1de11c395 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CustomConditions.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/CustomConditions.java @@ -65,11 +65,8 @@ public void check(JavaField field, ConditionEvents events) { String getter = calculateGetterPrefix(field.reflect().getType().getName()) + capitalize(name); if (!publicMethods.contains(getter)) { - String message = String.format( - GETTER_OR_SETTER_NOT_PRESENT_ERROR_MESSAGE, - field.getName(), - field.getOwner().getName(), - GETTER_PREFIX); + String message = GETTER_OR_SETTER_NOT_PRESENT_ERROR_MESSAGE.formatted( + field.getName(), field.getOwner().getName(), GETTER_PREFIX); events.add(SimpleConditionEvent.violated(field, message)); } @@ -77,11 +74,8 @@ public void check(JavaField field, ConditionEvents events) { String setter = SETTER_PREFIX + capitalize(name); if (!publicMethods.contains(setter)) { - String message = String.format( - GETTER_OR_SETTER_NOT_PRESENT_ERROR_MESSAGE, - field.getName(), - field.getOwner().getName(), - SETTER_PREFIX); + String message = GETTER_OR_SETTER_NOT_PRESENT_ERROR_MESSAGE.formatted( + field.getName(), field.getOwner().getName(), SETTER_PREFIX); events.add(SimpleConditionEvent.violated(field, message)); } } @@ -97,22 +91,18 @@ public void check(JavaClass javaClass, ConditionEvents events) { Optional equalsMethod = findPublicMethodFromClass(javaClass, EQUALS_METHOD); Optional hashCodeMethod = findPublicMethodFromClass(javaClass, HASH_CODE_METHOD); - if (!equalsMethod.isPresent()) { + if (equalsMethod.isEmpty()) { events.add(SimpleConditionEvent.violated( javaClass, - String.format( - EQUALS_OR_HASH_CODE_NOT_PRESENT_ERROR_MESSAGE, - EQUALS_METHOD, - javaClass.getName()))); + EQUALS_OR_HASH_CODE_NOT_PRESENT_ERROR_MESSAGE.formatted( + EQUALS_METHOD, javaClass.getName()))); } - if (!hashCodeMethod.isPresent()) { + if (hashCodeMethod.isEmpty()) { events.add(SimpleConditionEvent.violated( javaClass, - String.format( - EQUALS_OR_HASH_CODE_NOT_PRESENT_ERROR_MESSAGE, - HASH_CODE_METHOD, - javaClass.getName()))); + EQUALS_OR_HASH_CODE_NOT_PRESENT_ERROR_MESSAGE.formatted( + HASH_CODE_METHOD, javaClass.getName()))); } } }; @@ -127,8 +117,7 @@ public void check(JavaClass javaClass, ConditionEvents events) { .filter(m -> m.getModifiers().contains(JavaModifier.STATIC)) .forEach(m -> SimpleConditionEvent.violated( javaClass, - String.format( - "Static method %s in %s is not allowed", m.getName(), javaClass.getName()))); + "Static method %s in %s is not allowed".formatted(m.getName(), javaClass.getName()))); } }; } diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ModelRulesTest.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ModelRulesTest.java index 25c446739..13049fb95 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ModelRulesTest.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ModelRulesTest.java @@ -46,7 +46,7 @@ class ModelRulesTest { .resideInAPackage(MODEL_PACKAGE) .should() .beRecords() - .because(String.format("Resources should be records in %s", MODEL_PACKAGE)); + .because("Resources should be records in %s".formatted(MODEL_PACKAGE)); @ArchTest static final ArchRule staticMethodsAreNotAllowed = staticMethodsAreNotAllowedRule(MODEL_PACKAGE); diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/RepositoryRulesTest.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/RepositoryRulesTest.java index e653554e6..19a80c0d6 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/RepositoryRulesTest.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/RepositoryRulesTest.java @@ -23,7 +23,7 @@ class RepositoryRulesTest { .resideInAPackage(REPOSITORY_PACKAGE) .should() .beAnnotatedWith(Repository.class) - .because(String.format(ANNOTATED_EXPLANATION, REPOSITORY_SUFFIX, "@Repository")); + .because(ANNOTATED_EXPLANATION.formatted(REPOSITORY_SUFFIX, "@Repository")); @ArchTest static final ArchRule classesShouldBeInterfaces = interfacesAreOnlyAllowedRule(REPOSITORY_PACKAGE); diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ServiceRulesTest.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ServiceRulesTest.java index dbf23143b..5f735ad5a 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ServiceRulesTest.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/ServiceRulesTest.java @@ -31,7 +31,7 @@ class ServiceRulesTest { .resideInAPackage(SERVICE_PACKAGE) .should() .beAnnotatedWith(Service.class) - .because(String.format(ANNOTATED_EXPLANATION, SERVICE_SUFFIX, "@Service")); + .because(ANNOTATED_EXPLANATION.formatted(SERVICE_SUFFIX, "@Service")); // Fields @ArchTest diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/web/controllers/ClientControllerIT.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/web/controllers/ClientControllerIT.java index 9a2d37c3d..4c0599bfe 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/web/controllers/ClientControllerIT.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/web/controllers/ClientControllerIT.java @@ -58,7 +58,7 @@ void shouldFetchAllClients() throws Exception { @Test void shouldFindClientById() throws Exception { - Client client = clientList.get(0); + Client client = clientList.getFirst(); Long clientId = client.getId(); this.mockMvc @@ -104,7 +104,7 @@ void shouldReturn400WhenCreateNewClientWithoutText() throws Exception { @Test void shouldUpdateClient() throws Exception { - Long clientId = clientList.get(0).getId(); + Long clientId = clientList.getFirst().getId(); ClientRequest clientRequest = new ClientRequest("Updated Client"); this.mockMvc @@ -118,7 +118,7 @@ void shouldUpdateClient() throws Exception { @Test void shouldDeleteClient() throws Exception { - Client client = clientList.get(0); + Client client = clientList.getFirst(); this.mockMvc .perform(delete("/api/clients/{id}", client.getId())) diff --git a/boot-choas-monkey/pom.xml b/boot-choas-monkey/pom.xml index c5b95b47a..267318916 100644 --- a/boot-choas-monkey/pom.xml +++ b/boot-choas-monkey/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 3.9.5 diff --git a/boot-choas-monkey/src/main/java/com/example/choasmonkey/config/logging/LoggingAspect.java b/boot-choas-monkey/src/main/java/com/example/choasmonkey/config/logging/LoggingAspect.java index b99ef727f..ba42b9a2c 100644 --- a/boot-choas-monkey/src/main/java/com/example/choasmonkey/config/logging/LoggingAspect.java +++ b/boot-choas-monkey/src/main/java/com/example/choasmonkey/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.choasmonkey.config.logging.Loggable) || " - + "@annotation(com.example.choasmonkey.config.logging.Loggable)") + """ + @within(com.example.choasmonkey.config.logging.Loggable) || \ + @annotation(com.example.choasmonkey.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/boot-choas-monkey/src/test/java/com/example/choasmonkey/web/controllers/CustomerControllerIT.java b/boot-choas-monkey/src/test/java/com/example/choasmonkey/web/controllers/CustomerControllerIT.java index 9d43b52a0..63388b629 100644 --- a/boot-choas-monkey/src/test/java/com/example/choasmonkey/web/controllers/CustomerControllerIT.java +++ b/boot-choas-monkey/src/test/java/com/example/choasmonkey/web/controllers/CustomerControllerIT.java @@ -53,7 +53,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -99,7 +99,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setText("Updated Customer"); this.mockMvc @@ -113,7 +113,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId())) diff --git a/boot-mongodb-elasticsearch/pom.xml b/boot-mongodb-elasticsearch/pom.xml index ab00b6f9b..c3174df5d 100644 --- a/boot-mongodb-elasticsearch/pom.xml +++ b/boot-mongodb-elasticsearch/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 ${project.build.directory}/test-results @@ -53,6 +53,11 @@ org.springframework.boot spring-boot-starter-webflux + + org.glassfish.jaxb + jaxb-runtime + provided + org.springframework.boot spring-boot-starter-data-mongodb-reactive diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/logging/LoggingAspect.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/logging/LoggingAspect.java index d39ca296e..6c3c8dd32 100644 --- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/logging/LoggingAspect.java +++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.mongoes.config.logging.Loggable) || " - + "@annotation(com.example.mongoes.config.logging.Loggable)") + """ + @within(com.example.mongoes.config.logging.Loggable) || \ + @annotation(com.example.mongoes.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java index ead45aab2..d995b3882 100644 --- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java +++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java @@ -88,8 +88,7 @@ public ResponseEntity createRestaurant( .map(Restaurant::getName)))) .body( new GenericMessage( - String.format( - "restaurant with name %s created", - restaurantRequest.name()))); + "restaurant with name %s created" + .formatted(restaurantRequest.name()))); } } diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/service/RestaurantService.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/service/RestaurantService.java index 2fbde2c65..60e94c384 100644 --- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/service/RestaurantService.java +++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/service/RestaurantService.java @@ -78,7 +78,7 @@ private Flux saveAll(List restaurantStringList) { Integer.valueOf( addressDoc.get("zipcode", String.class))); List obj = addressDoc.getList("coord", Double.class); - Point geoJsonPoint = new Point(obj.get(0), obj.get(1)); + Point geoJsonPoint = new Point(obj.getFirst(), obj.get(1)); address.setLocation(geoJsonPoint); restaurant.setAddress(address); List gradesList = @@ -193,7 +193,7 @@ private ChangeStreamOptions getChangeStreamOption() { } else { changeStreamOptionsBuilder = ChangeStreamOptions.builder() - .resumeAt(resumeTokenList.get(0).getResumeTimestamp()); + .resumeAt(resumeTokenList.getFirst().getResumeTimestamp()); } changeStreamOptionsBuilder.returnFullDocumentOnUpdate(); return changeStreamOptionsBuilder.build(); diff --git a/boot-opensearch-sample/pom.xml b/boot-opensearch-sample/pom.xml index 295830cfc..2e8913078 100644 --- a/boot-opensearch-sample/pom.xml +++ b/boot-opensearch-sample/pom.xml @@ -55,6 +55,11 @@ org.springframework.boot spring-boot-starter-web + + + org.glassfish.jaxb + jaxb-runtime + provided org.opensearch.client diff --git a/boot-opensearch-sample/src/test/java/com/example/opensearch/web/controllers/RestaurantControllerIT.java b/boot-opensearch-sample/src/test/java/com/example/opensearch/web/controllers/RestaurantControllerIT.java index b51219611..84bbebd2e 100644 --- a/boot-opensearch-sample/src/test/java/com/example/opensearch/web/controllers/RestaurantControllerIT.java +++ b/boot-opensearch-sample/src/test/java/com/example/opensearch/web/controllers/RestaurantControllerIT.java @@ -70,7 +70,7 @@ void shouldFetchAllRestaurants() throws Exception { @Test void shouldFindRestaurantById() throws Exception { - Restaurant restaurant = restaurantList.get(0); + Restaurant restaurant = restaurantList.getFirst(); String restaurantId = restaurant.getId(); this.mockMvc @@ -129,7 +129,7 @@ void shouldReturn400WhenCreateNewRestaurantWithoutText() throws Exception { @Test void shouldUpdateRestaurant() throws Exception { - Restaurant restaurant = restaurantList.get(0); + Restaurant restaurant = restaurantList.getFirst(); restaurant.setName("Updated Restaurant"); this.mockMvc @@ -144,7 +144,7 @@ void shouldUpdateRestaurant() throws Exception { @Test void shouldDeleteRestaurant() throws Exception { - Restaurant restaurant = restaurantList.get(0); + Restaurant restaurant = restaurantList.getFirst(); this.mockMvc .perform(delete("/api/restaurants/{id}", restaurant.getId())) diff --git a/boot-rabbitmq-thymeleaf/pom.xml b/boot-rabbitmq-thymeleaf/pom.xml index 8c757f56d..050e86212 100644 --- a/boot-rabbitmq-thymeleaf/pom.xml +++ b/boot-rabbitmq-thymeleaf/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.40.0 0.8.11 @@ -30,49 +30,54 @@ ${jacoco.itReportFolder}/integrationTest.exec ${project.testresult.directory}/test ${project.testresult.directory}/integrationTest - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-amqp - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.liquibase - liquibase-core - - - - com.h2database - h2 - runtime - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - - org.webjars - webjars-locator-core + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-amqp + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.liquibase + liquibase-core + + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + + org.webjars + webjars-locator-core + + + org.glassfish.jaxb + jaxb-runtime + provided org.webjars diff --git a/boot-rabbitmq-thymeleaf/src/test/java/com/poc/boot/rabbitmq/service/impl/OrderMessageSenderTest.java b/boot-rabbitmq-thymeleaf/src/test/java/com/poc/boot/rabbitmq/service/impl/OrderMessageSenderTest.java index 49e9950dd..36002995c 100644 --- a/boot-rabbitmq-thymeleaf/src/test/java/com/poc/boot/rabbitmq/service/impl/OrderMessageSenderTest.java +++ b/boot-rabbitmq-thymeleaf/src/test/java/com/poc/boot/rabbitmq/service/impl/OrderMessageSenderTest.java @@ -33,7 +33,10 @@ class OrderMessageSenderTest { @Test void testSendOrder() throws JsonProcessingException { String convertedString = - "{\"orderNumber\":\"1\",\"productId\":\"P1\"," + "\"amount\":10.0}"; + """ + {"orderNumber":"1","productId":"P1",\ + "amount":10.0}\ + """; // given given(this.objectMapper.writeValueAsString(MockObjectCreator.getOrder())) .willReturn(convertedString); diff --git a/boot-rest-docs-sample/pom.xml b/boot-rest-docs-sample/pom.xml index 6519bc7cd..09a002cbb 100644 --- a/boot-rest-docs-sample/pom.xml +++ b/boot-rest-docs-sample/pom.xml @@ -20,7 +20,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 ${project.build.directory}/test-results diff --git a/boot-rest-docs-sample/src/main/java/com/example/restdocs/config/logging/LoggingAspect.java b/boot-rest-docs-sample/src/main/java/com/example/restdocs/config/logging/LoggingAspect.java index ce04ea62c..37c573a66 100644 --- a/boot-rest-docs-sample/src/main/java/com/example/restdocs/config/logging/LoggingAspect.java +++ b/boot-rest-docs-sample/src/main/java/com/example/restdocs/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.restdocs.config.logging.Loggable) || " - + "@annotation(com.example.restdocs.config.logging.Loggable)") + """ + @within(com.example.restdocs.config.logging.Loggable) || \ + @annotation(com.example.restdocs.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/boot-rest-docs-sample/src/test/java/com/example/restdocs/web/controllers/UserControllerIT.java b/boot-rest-docs-sample/src/test/java/com/example/restdocs/web/controllers/UserControllerIT.java index 28d78437e..44c6b9b20 100644 --- a/boot-rest-docs-sample/src/test/java/com/example/restdocs/web/controllers/UserControllerIT.java +++ b/boot-rest-docs-sample/src/test/java/com/example/restdocs/web/controllers/UserControllerIT.java @@ -57,7 +57,7 @@ void shouldFetchAllUsers() throws Exception { @Test void shouldFindUserById() throws Exception { - User user = userList.get(0); + User user = userList.getFirst(); Long userId = user.getId(); this.mockMvc @@ -115,7 +115,7 @@ void shouldReturn400WhenCreateNewUserWithoutFirstName() throws Exception { @Test void shouldUpdateUser() throws Exception { - User user = userList.get(0); + User user = userList.getFirst(); UserRequest userRequest = new UserRequest("Updated User", "Last Name", 50, Gender.FEMALE, "9848022334"); @@ -135,7 +135,7 @@ void shouldUpdateUser() throws Exception { @Test void shouldDeleteUser() throws Exception { - User user = userList.get(0); + User user = userList.getFirst(); this.mockMvc .perform(delete("/api/users/{id}", user.getId())) diff --git a/boot-togglz-sample/pom.xml b/boot-togglz-sample/pom.xml index 47921aef4..98855b02c 100644 --- a/boot-togglz-sample/pom.xml +++ b/boot-togglz-sample/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 4.4.0 diff --git a/boot-togglz-sample/src/main/java/com/example/featuretoggle/config/logging/LoggingAspect.java b/boot-togglz-sample/src/main/java/com/example/featuretoggle/config/logging/LoggingAspect.java index cf5ff6d25..e50c80fb1 100644 --- a/boot-togglz-sample/src/main/java/com/example/featuretoggle/config/logging/LoggingAspect.java +++ b/boot-togglz-sample/src/main/java/com/example/featuretoggle/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.featuretoggle.config.logging.Loggable) || " - + "@annotation(com.example.featuretoggle.config.logging.Loggable)") + """ + @within(com.example.featuretoggle.config.logging.Loggable) || \ + @annotation(com.example.featuretoggle.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/boot-togglz-sample/src/test/java/com/example/featuretoggle/web/controllers/CustomerControllerIT.java b/boot-togglz-sample/src/test/java/com/example/featuretoggle/web/controllers/CustomerControllerIT.java index 67ee2a6c7..caad52459 100644 --- a/boot-togglz-sample/src/test/java/com/example/featuretoggle/web/controllers/CustomerControllerIT.java +++ b/boot-togglz-sample/src/test/java/com/example/featuretoggle/web/controllers/CustomerControllerIT.java @@ -47,7 +47,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -96,7 +96,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setText("Updated Customer"); this.mockMvc @@ -113,7 +113,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId())) diff --git a/boot-ultimate-redis/pom.xml b/boot-ultimate-redis/pom.xml index 1b078d573..b46ca188d 100644 --- a/boot-ultimate-redis/pom.xml +++ b/boot-ultimate-redis/pom.xml @@ -35,6 +35,11 @@ org.springframework.boot spring-boot-starter-data-redis + + org.glassfish.jaxb + jaxb-runtime + test + commons-io commons-io diff --git a/graphql/boot-graphql-querydsl/pom.xml b/graphql/boot-graphql-querydsl/pom.xml index c0f2f278a..436b9e5b1 100644 --- a/graphql/boot-graphql-querydsl/pom.xml +++ b/graphql/boot-graphql-querydsl/pom.xml @@ -173,8 +173,8 @@ org.apache.maven.plugins maven-compiler-plugin - ${java.version} - ${java.version} + + org.mapstruct @@ -209,6 +209,7 @@ -Amapstruct.verbose=true + ${java.version} diff --git a/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/gql/PostControllerQLIntTest.java b/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/gql/PostControllerQLIntTest.java index f01afe272..28993dab6 100644 --- a/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/gql/PostControllerQLIntTest.java +++ b/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/gql/PostControllerQLIntTest.java @@ -81,14 +81,14 @@ void testCreatePost() { .entityList(PostCommentResponse.class) .hasSize(1) .satisfies(postCommentResponses -> { - assertThat(postCommentResponses.get(0).review()).isEqualTo("JunitReview"); - assertThat(postCommentResponses.get(0).createdOn()).isInstanceOf(LocalDateTime.class); + assertThat(postCommentResponses.getFirst().review()).isEqualTo("JunitReview"); + assertThat(postCommentResponses.getFirst().createdOn()).isInstanceOf(LocalDateTime.class); }) .path("createPost.tags") .entityList(TagResponse.class) .hasSize(1) - .satisfies( - tagResponses -> assertThat(tagResponses.get(0).name()).isEqualTo("junit")); + .satisfies(tagResponses -> + assertThat(tagResponses.getFirst().name()).isEqualTo("junit")); } @Test @@ -113,8 +113,8 @@ void testGetPostsByUserName() { .entityList(PostCommentResponse.class) .hasSize(1) .satisfies(postCommentResponses -> { - assertThat(postCommentResponses.get(0).review()).isEqualTo("First Review"); - assertThat(postCommentResponses.get(0).createdOn()).isInstanceOf(LocalDateTime.class); + assertThat(postCommentResponses.getFirst().review()).isEqualTo("First Review"); + assertThat(postCommentResponses.getFirst().createdOn()).isInstanceOf(LocalDateTime.class); }) .path("getPostsByUserName[0].tags") .entityList(TagResponse.class) @@ -144,13 +144,13 @@ void testAddTagsToPosts() { .entityList(PostCommentResponse.class) .hasSize(1) .satisfies(postCommentResponses -> { - assertThat(postCommentResponses.get(0).review()).isEqualTo("Third Review"); - assertThat(postCommentResponses.get(0).createdOn()).isInstanceOf(LocalDateTime.class); + assertThat(postCommentResponses.getFirst().review()).isEqualTo("Third Review"); + assertThat(postCommentResponses.getFirst().createdOn()).isInstanceOf(LocalDateTime.class); }) .path("addTagsToPost.tags") .entityList(TagResponse.class) .hasSize(1) - .satisfies( - tagResponses -> assertThat(tagResponses.get(0).name()).isEqualTo("junit")); + .satisfies(tagResponses -> + assertThat(tagResponses.getFirst().name()).isEqualTo("junit")); } } diff --git a/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/PostControllerIT.java b/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/PostControllerIT.java index 66f676925..266ec40fd 100644 --- a/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/PostControllerIT.java +++ b/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/PostControllerIT.java @@ -62,7 +62,7 @@ void shouldFetchAllPosts() throws Exception { @Test void shouldFindPostById() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); Long postId = post.getId(); this.mockMvc @@ -127,7 +127,7 @@ void shouldReturn400WhenCreateNewPostWithoutTitleAndContent() throws Exception { @Test void shouldUpdatePost() throws Exception { - Long postId = postList.get(0).getId(); + Long postId = postList.getFirst().getId(); UpdatePostRequest updatePostRequest = new UpdatePostRequest("Updated Post", "New Content"); this.mockMvc @@ -142,7 +142,7 @@ void shouldUpdatePost() throws Exception { @Test void shouldDeletePost() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); this.mockMvc .perform(delete("/api/posts/{id}", post.getId())) diff --git a/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/TagControllerIT.java b/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/TagControllerIT.java index 76eaca7d4..8cef0ae52 100644 --- a/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/TagControllerIT.java +++ b/graphql/boot-graphql-querydsl/src/test/java/com/example/graphql/querydsl/web/controllers/TagControllerIT.java @@ -58,7 +58,7 @@ void shouldFetchAllTags() throws Exception { @Test void shouldFindTagById() throws Exception { - Tag tag = tagList.get(0); + Tag tag = tagList.getFirst(); Long tagId = tag.getId(); this.mockMvc @@ -104,7 +104,7 @@ void shouldReturn400WhenCreateNewTagWithoutName() throws Exception { @Test void shouldUpdateTag() throws Exception { - Long tagId = tagList.get(0).getId(); + Long tagId = tagList.getFirst().getId(); TagRequest tagRequest = new TagRequest("Updated Tag"); this.mockMvc @@ -118,7 +118,7 @@ void shouldUpdateTag() throws Exception { @Test void shouldDeleteTag() throws Exception { - Tag tag = tagList.get(0); + Tag tag = tagList.getFirst(); this.mockMvc .perform(delete("/api/tags/{id}", tag.getId())) diff --git a/graphql/boot-graphql-webflux/pom.xml b/graphql/boot-graphql-webflux/pom.xml index 810358f40..29e9b7bac 100644 --- a/graphql/boot-graphql-webflux/pom.xml +++ b/graphql/boot-graphql-webflux/pom.xml @@ -31,33 +31,38 @@ ${jacoco.itReportFolder}/integrationTest.exec ${project.testresult.directory}/test ${project.testresult.directory}/integrationTest - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-aop - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.boot - spring-boot-starter-graphql - - - org.springframework.boot - spring-boot-starter-data-r2dbc - - - org.springframework.boot - spring-boot-starter-webflux - + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-graphql + + + org.springframework.boot + spring-boot-starter-data-r2dbc + + + org.springframework.boot + spring-boot-starter-webflux + + + org.glassfish.jaxb + jaxb-runtime + provided + org.liquibase liquibase-core diff --git a/graphql/boot-graphql-webmvc/pom.xml b/graphql/boot-graphql-webmvc/pom.xml index 17301263f..e50e5254c 100644 --- a/graphql/boot-graphql-webmvc/pom.xml +++ b/graphql/boot-graphql-webmvc/pom.xml @@ -175,8 +175,8 @@ org.apache.maven.plugins maven-compiler-plugin - ${java.version} - ${java.version} + + org.mapstruct @@ -216,6 +216,7 @@ -Amapstruct.verbose=true + ${java.version} diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/AuthorEntityQueryTest.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/AuthorEntityQueryTest.java index 6599609c0..6f6527275 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/AuthorEntityQueryTest.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/AuthorEntityQueryTest.java @@ -93,10 +93,11 @@ void testFindAuthorByEmailId() { .satisfy( responseErrors -> { assertThat(responseErrors.size()).isEqualTo(1); - assertThat(responseErrors.get(0).getPath()) + assertThat(responseErrors.getFirst().getPath()) .isEqualTo("findAuthorByEmailId"); - assertThat(responseErrors.get(0).getErrorType()).isEqualTo(NOT_FOUND); - assertThat(responseErrors.get(0).getMessage()) + assertThat(responseErrors.getFirst().getErrorType()) + .isEqualTo(NOT_FOUND); + assertThat(responseErrors.getFirst().getMessage()) .isEqualTo("Author: junit@email.com was not found."); }); diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/AuthorEntityControllerIT.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/AuthorEntityControllerIT.java index db0215b03..5c3a6ce71 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/AuthorEntityControllerIT.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/AuthorEntityControllerIT.java @@ -64,7 +64,7 @@ void shouldFetchAllAuthors() throws Exception { @Test void shouldFindAuthorById() throws Exception { - AuthorEntity authorEntity = authorEntityList.get(0); + AuthorEntity authorEntity = authorEntityList.getFirst(); Long authorId = authorEntity.getId(); this.mockMvc @@ -117,7 +117,7 @@ void shouldReturn400WhenCreateNewAuthorWithoutValidData() throws Exception { @Test void shouldUpdateAuthor() throws Exception { - AuthorEntity authorEntity = authorEntityList.get(0); + AuthorEntity authorEntity = authorEntityList.getFirst(); authorEntity.setFirstName("Updated Author"); this.mockMvc @@ -131,7 +131,7 @@ void shouldUpdateAuthor() throws Exception { @Test void shouldDeleteAuthor() throws Exception { - AuthorEntity authorEntity = authorEntityList.get(0); + AuthorEntity authorEntity = authorEntityList.getFirst(); this.mockMvc .perform(delete("/api/authors/{id}", authorEntity.getId())) diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostCommentEntityControllerTest.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostCommentEntityControllerTest.java index 902b91a23..9d9f006c1 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostCommentEntityControllerTest.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostCommentEntityControllerTest.java @@ -73,10 +73,10 @@ void shouldFetchAllPostComments() throws Exception { @Test void shouldFindPostCommentById() throws Exception { - PostCommentResponse postCommentResponse = postCommentResponseList.get(0); + PostCommentResponse postCommentResponse = postCommentResponseList.getFirst(); Long postCommentId = postCommentResponse.postId(); given(postCommentService.findPostCommentById(postCommentId)) - .willReturn(Optional.of(postCommentResponseList.get(0))); + .willReturn(Optional.of(postCommentResponseList.getFirst())); this.mockMvc .perform(get("/api/postcomments/{id}", postCommentId)) @@ -154,7 +154,7 @@ void shouldReturn400WhenCreateNewPostCommentWithoutText() throws Exception { @Test void shouldUpdatePostComment() throws Exception { - PostCommentResponse postCommentResponse = postCommentResponseList.get(0); + PostCommentResponse postCommentResponse = postCommentResponseList.getFirst(); Long postCommentId = postCommentResponse.postId(); PostCommentRequest postCommentRequest = new PostCommentRequest("First Title", "First Content", postCommentId, true); @@ -192,10 +192,10 @@ void shouldReturn404WhenUpdatingNonExistingPostComment() throws Exception { @Test void shouldDeletePostComment() throws Exception { - PostCommentResponse postCommentResponse = postCommentResponseList.get(0); + PostCommentResponse postCommentResponse = postCommentResponseList.getFirst(); Long postCommentId = postCommentResponse.postId(); given(postCommentService.findPostCommentById(postCommentId)) - .willReturn(Optional.of(postCommentResponseList.get(0))); + .willReturn(Optional.of(postCommentResponseList.getFirst())); doNothing().when(postCommentService).deletePostCommentById(postCommentId); this.mockMvc diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerIT.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerIT.java index cea63f7be..8a65c87da 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerIT.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerIT.java @@ -55,7 +55,7 @@ void shouldFetchAllPosts() throws Exception { @Test void shouldFindPostById() throws Exception { - PostEntity postEntity = postEntityList.get(0); + PostEntity postEntity = postEntityList.getFirst(); Long postId = postEntity.getId(); this.mockMvc @@ -99,7 +99,7 @@ void shouldUpdatePost() throws Exception { this.mockMvc .perform( - put("/api/posts/{id}", postEntityList.get(0).getId()) + put("/api/posts/{id}", postEntityList.getFirst().getId()) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(postEntity))) .andExpect(status().isOk()) @@ -108,7 +108,7 @@ void shouldUpdatePost() throws Exception { @Test void shouldDeletePost() throws Exception { - PostEntity postEntity = postEntityList.get(0); + PostEntity postEntity = postEntityList.getFirst(); this.mockMvc .perform(delete("/api/posts/{id}", postEntity.getId())) diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerTest.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerTest.java index ad0a5eaae..557746828 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerTest.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/PostEntityControllerTest.java @@ -73,7 +73,8 @@ void shouldFetchAllPosts() throws Exception { @Test void shouldFindPostById() throws Exception { Long postId = 1L; - given(postService.findPostById(postId)).willReturn(Optional.of(postResponseList.get(0))); + given(postService.findPostById(postId)) + .willReturn(Optional.of(postResponseList.getFirst())); this.mockMvc .perform(get("/api/posts/{id}", postId)) @@ -102,7 +103,8 @@ void shouldReturn404WhenFetchingNonExistingPost() throws Exception { @Test void shouldCreateNewPost() throws Exception { - given(postService.savePost(any(NewPostRequest.class))).willReturn(postResponseList.get(0)); + given(postService.savePost(any(NewPostRequest.class))) + .willReturn(postResponseList.getFirst()); NewPostRequest postEntity = new NewPostRequest( @@ -196,7 +198,8 @@ void shouldReturn404WhenUpdatingNonExistingPost() throws Exception { void shouldDeletePost() throws Exception { Long postId = 1L; PostEntity postEntity = new PostEntity().setId(postId).setContent("First Post"); - given(postService.findPostById(postId)).willReturn(Optional.of(postResponseList.get(0))); + given(postService.findPostById(postId)) + .willReturn(Optional.of(postResponseList.getFirst())); doNothing().when(postService).deletePostById(postEntity.getId()); this.mockMvc diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/TagEntityControllerIT.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/TagEntityControllerIT.java index 0908ff92c..52095db4f 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/TagEntityControllerIT.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/web/controllers/TagEntityControllerIT.java @@ -46,7 +46,7 @@ void shouldFetchAllTags() throws Exception { @Test void shouldFindTagById() throws Exception { - TagEntity tagEntity = tagEntityList.get(0); + TagEntity tagEntity = tagEntityList.getFirst(); Long tagId = tagEntity.getId(); this.mockMvc @@ -70,7 +70,7 @@ void shouldCreateNewTag() throws Exception { @Test void shouldUpdateTag() throws Exception { - TagEntity tagEntity = tagEntityList.get(0); + TagEntity tagEntity = tagEntityList.getFirst(); tagEntity.setTagName("Updated Tag"); this.mockMvc @@ -84,7 +84,7 @@ void shouldUpdateTag() throws Exception { @Test void shouldDeleteTag() throws Exception { - TagEntity tagEntity = tagEntityList.get(0); + TagEntity tagEntity = tagEntityList.getFirst(); this.mockMvc .perform(delete("/api/tags/{id}", tagEntity.getId())) diff --git a/httpClients/boot-http-proxy/src/test/java/com/example/rest/proxy/web/controllers/PostControllerIT.java b/httpClients/boot-http-proxy/src/test/java/com/example/rest/proxy/web/controllers/PostControllerIT.java index 819349db5..c588b17a6 100644 --- a/httpClients/boot-http-proxy/src/test/java/com/example/rest/proxy/web/controllers/PostControllerIT.java +++ b/httpClients/boot-http-proxy/src/test/java/com/example/rest/proxy/web/controllers/PostControllerIT.java @@ -55,7 +55,7 @@ void shouldFetchAllPosts() throws Exception { @Test void shouldFindPostById() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); Long postId = post.getId(); this.mockMvc @@ -109,7 +109,7 @@ void shouldReturn400WhenCreateNewPostWithoutTitleAndBody() throws Exception { @Test void shouldUpdatePost() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); post.setTitle("Updated Post Title"); this.mockMvc @@ -124,7 +124,7 @@ void shouldUpdatePost() throws Exception { @Test void shouldDeletePost() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); this.mockMvc .perform(delete("/api/posts/{id}", post.getId())) diff --git a/httpClients/boot-rest-template/src/test/java/com/example/rest/template/web/controllers/PostControllerIT.java b/httpClients/boot-rest-template/src/test/java/com/example/rest/template/web/controllers/PostControllerIT.java index ce47cb513..59c6c4c8a 100644 --- a/httpClients/boot-rest-template/src/test/java/com/example/rest/template/web/controllers/PostControllerIT.java +++ b/httpClients/boot-rest-template/src/test/java/com/example/rest/template/web/controllers/PostControllerIT.java @@ -55,7 +55,7 @@ void shouldFetchAllPosts() throws Exception { @Test void shouldFindPostById() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); Long postId = post.getId(); this.mockMvc @@ -109,7 +109,7 @@ void shouldReturn400WhenCreateNewPostWithoutTitleAndBody() throws Exception { @Test void shouldUpdatePost() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); post.setTitle("Updated Post Title"); this.mockMvc @@ -124,7 +124,7 @@ void shouldUpdatePost() throws Exception { @Test void shouldDeletePost() throws Exception { - Post post = postList.get(0); + Post post = postList.getFirst(); this.mockMvc .perform(delete("/api/posts/{id}", post.getId())) diff --git a/httpClients/boot-restclient/pom.xml b/httpClients/boot-restclient/pom.xml index dcb38c014..6eb467eb7 100644 --- a/httpClients/boot-restclient/pom.xml +++ b/httpClients/boot-restclient/pom.xml @@ -18,17 +18,22 @@ 21 2.2.0 2.40.0 - - - - - org.springframework.boot - spring-boot-starter-actuator + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-web + + + org.glassfish.jaxb + jaxb-runtime + provided - - org.springframework.boot - spring-boot-starter-web - org.springframework.boot spring-boot-starter-validation diff --git a/httpClients/boot-web-client-mvc/pom.xml b/httpClients/boot-web-client-mvc/pom.xml index 8be5f12df..4b16717e9 100644 --- a/httpClients/boot-web-client-mvc/pom.xml +++ b/httpClients/boot-web-client-mvc/pom.xml @@ -57,6 +57,11 @@ org.springframework.boot spring-boot-starter-webflux + + org.glassfish.jaxb + jaxb-runtime + provided + org.springframework.boot spring-boot-devtools diff --git a/httpClients/web-client-webflux/pom.xml b/httpClients/web-client-webflux/pom.xml index 40329cdf0..b30cb09bf 100644 --- a/httpClients/web-client-webflux/pom.xml +++ b/httpClients/web-client-webflux/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 1.5.5.Final @@ -51,6 +51,11 @@ org.springframework.boot spring-boot-starter-webflux + + org.glassfish.jaxb + jaxb-runtime + provided + org.springframework.boot spring-boot-devtools @@ -179,8 +184,8 @@ org.apache.maven.plugins maven-compiler-plugin - ${java.version} - ${java.version} + + org.mapstruct @@ -200,6 +205,7 @@ 0.2.0 + ${java.version} diff --git a/httpClients/web-client-webflux/src/main/java/com/example/rest/webclient/config/logging/LoggingAspect.java b/httpClients/web-client-webflux/src/main/java/com/example/rest/webclient/config/logging/LoggingAspect.java index 783b6849c..9aa3279b6 100644 --- a/httpClients/web-client-webflux/src/main/java/com/example/rest/webclient/config/logging/LoggingAspect.java +++ b/httpClients/web-client-webflux/src/main/java/com/example/rest/webclient/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.rest.webclient.config.logging.Loggable) || " - + "@annotation(com.example.rest.webclient.config.logging.Loggable)") + """ + @within(com.example.rest.webclient.config.logging.Loggable) || \ + @annotation(com.example.rest.webclient.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jmh-benchmark/pom.xml b/jmh-benchmark/pom.xml index 5236d39f8..dd17e7564 100644 --- a/jmh-benchmark/pom.xml +++ b/jmh-benchmark/pom.xml @@ -9,8 +9,8 @@ 1.0-SNAPSHOT - 17 - 17 + 21 + 21 UTF-8 1.37 diff --git a/jpa/boot-data-customsequence/pom.xml b/jpa/boot-data-customsequence/pom.xml index bd89f0465..0f1f47f8b 100644 --- a/jpa/boot-data-customsequence/pom.xml +++ b/jpa/boot-data-customsequence/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 1.9.0 diff --git a/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/StringPrefixedNumberFormattedSequenceIdGenerator.java b/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/StringPrefixedNumberFormattedSequenceIdGenerator.java index 4ea5858cf..4a4965b09 100644 --- a/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/StringPrefixedNumberFormattedSequenceIdGenerator.java +++ b/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/StringPrefixedNumberFormattedSequenceIdGenerator.java @@ -24,7 +24,7 @@ public class StringPrefixedNumberFormattedSequenceIdGenerator extends SequenceSt @Override public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException { - return valuePrefix + String.format(numberFormat, super.generate(session, object)); + return valuePrefix + numberFormat.formatted(super.generate(session, object)); } @Override diff --git a/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/logging/LoggingAspect.java b/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/logging/LoggingAspect.java index f2a03e3ea..581f5a70e 100644 --- a/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/logging/LoggingAspect.java +++ b/jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.custom.sequence.config.logging.Loggable) || " - + "@annotation(com.example.custom.sequence.config.logging.Loggable)") + """ + @within(com.example.custom.sequence.config.logging.Loggable) || \ + @annotation(com.example.custom.sequence.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/CustomerControllerIT.java b/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/CustomerControllerIT.java index a280e0d69..3dd269537 100644 --- a/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/CustomerControllerIT.java +++ b/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/CustomerControllerIT.java @@ -55,7 +55,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); String customerId = customer.getId(); this.mockMvc @@ -102,7 +102,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setText("Updated Customer"); this.mockMvc @@ -116,7 +116,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId())) diff --git a/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java b/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java index 578206ab1..feb3988e6 100644 --- a/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java +++ b/jpa/boot-data-customsequence/src/test/java/com/example/custom/sequence/web/controllers/OrderControllerIT.java @@ -62,7 +62,7 @@ void shouldFetchAllOrders() throws Exception { @Test void shouldFindOrderById() throws Exception { - Order order = orderList.get(0); + Order order = orderList.getFirst(); String orderId = order.getId(); this.mockMvc @@ -109,7 +109,7 @@ void shouldReturn400WhenCreateNewOrderWithoutText() throws Exception { @Test void shouldUpdateOrder() throws Exception { - Order order = orderList.get(0); + Order order = orderList.getFirst(); order.setText("Updated Order"); this.mockMvc @@ -124,7 +124,7 @@ void shouldUpdateOrder() throws Exception { @Test void shouldDeleteOrder() throws Exception { - Order order = orderList.get(0); + Order order = orderList.getFirst(); this.mockMvc .perform(delete("/api/orders/{id}", order.getId())) diff --git a/jpa/boot-data-envers/pom.xml b/jpa/boot-data-envers/pom.xml index 4ad987477..76e58e9c4 100644 --- a/jpa/boot-data-envers/pom.xml +++ b/jpa/boot-data-envers/pom.xml @@ -20,7 +20,7 @@ UTF-8 UTF-8 - 17 + 21 2022.0.4 2.2.0 diff --git a/jpa/boot-data-envers/src/main/java/com/example/envers/config/logging/LoggingAspect.java b/jpa/boot-data-envers/src/main/java/com/example/envers/config/logging/LoggingAspect.java index abbefa1e1..4ebb9a345 100644 --- a/jpa/boot-data-envers/src/main/java/com/example/envers/config/logging/LoggingAspect.java +++ b/jpa/boot-data-envers/src/main/java/com/example/envers/config/logging/LoggingAspect.java @@ -25,15 +25,21 @@ public LoggingAspect(Environment env) { this.env = env; } - @Pointcut("within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + @Pointcut( + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } - @Pointcut("@within(com.example.envers.config.logging.Loggable) || " - + "@annotation(com.example.envers.config.logging.Loggable)") + @Pointcut( + """ + @within(com.example.envers.config.logging.Loggable) || \ + @annotation(com.example.envers.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jpa/boot-data-envers/src/test/java/com/example/envers/web/controllers/CustomerControllerIT.java b/jpa/boot-data-envers/src/test/java/com/example/envers/web/controllers/CustomerControllerIT.java index 72c58e230..a4ce2813f 100644 --- a/jpa/boot-data-envers/src/test/java/com/example/envers/web/controllers/CustomerControllerIT.java +++ b/jpa/boot-data-envers/src/test/java/com/example/envers/web/controllers/CustomerControllerIT.java @@ -64,7 +64,7 @@ class Find { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); mockMvc.perform(get("/api/customers/{id}", customerId)) @@ -76,7 +76,7 @@ void shouldFindCustomerById() throws Exception { @Test void shouldFindCustomerRevisionsById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); mockMvc.perform(get("/api/customers/{id}/revisions", customerId)) @@ -127,7 +127,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutName() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Long customerId = customerList.get(0).getId(); + Long customerId = customerList.getFirst().getId(); CustomerRequest customerRequest = new CustomerRequest("Updated Customer", "Junit Address"); this.mockMvc @@ -142,7 +142,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId())) diff --git a/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/config/Initializer.java b/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/config/Initializer.java index f3a92e61d..ed4f29359 100644 --- a/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/config/Initializer.java +++ b/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/config/Initializer.java @@ -26,7 +26,7 @@ public void run(String... args) { actorId -> { Actor actor = new Actor(); actor.setId(actorId); - actor.setText(String.format("Actor - %d", actorId)); + actor.setText("Actor - %d".formatted(actorId)); if (actorId % 2 == 0) { actor.setCreatedOn(LocalDate.now().minusDays(actorId)); } else { diff --git a/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/model/query/ActorsFilter.java b/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/model/query/ActorsFilter.java index 6ce562226..cb88f3c55 100644 --- a/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/model/query/ActorsFilter.java +++ b/jpa/boot-data-keyset-pagination/src/main/java/com/example/keysetpagination/model/query/ActorsFilter.java @@ -18,7 +18,7 @@ public ActorsFilter() {} @JsonIgnore public String getValue() { - return values.get(0); + return values.getFirst(); } public void setValue(String value) { @@ -35,7 +35,7 @@ public String getLow() { if (values == null || values.isEmpty()) { return null; } - return values.get(0); + return values.getFirst(); } public void setLow(String low) { diff --git a/jpa/boot-data-keyset-pagination/src/test/java/com/example/keysetpagination/web/controllers/ActorControllerIT.java b/jpa/boot-data-keyset-pagination/src/test/java/com/example/keysetpagination/web/controllers/ActorControllerIT.java index 0e507a145..d08472442 100644 --- a/jpa/boot-data-keyset-pagination/src/test/java/com/example/keysetpagination/web/controllers/ActorControllerIT.java +++ b/jpa/boot-data-keyset-pagination/src/test/java/com/example/keysetpagination/web/controllers/ActorControllerIT.java @@ -130,7 +130,7 @@ void shouldSearchAllActors() throws Exception { @Test void shouldFindActorById() throws Exception { - Actor actor = actorList.get(0); + Actor actor = actorList.getFirst(); Long actorId = actor.getId(); this.mockMvc @@ -178,7 +178,7 @@ void shouldReturn400WhenCreateNewActorWithoutText() throws Exception { @Test void shouldUpdateActor() throws Exception { - Long actorId = actorList.get(0).getId(); + Long actorId = actorList.getFirst().getId(); ActorRequest actorRequest = new ActorRequest("Updated Actor"); this.mockMvc @@ -193,7 +193,7 @@ void shouldUpdateActor() throws Exception { @Test void shouldDeleteActor() throws Exception { - Actor actor = actorList.get(0); + Actor actor = actorList.getFirst(); this.mockMvc .perform(delete("/api/actors/{id}", actor.getId())) diff --git a/jpa/boot-data-multipledatasources/pom.xml b/jpa/boot-data-multipledatasources/pom.xml index a6425349f..432900831 100644 --- a/jpa/boot-data-multipledatasources/pom.xml +++ b/jpa/boot-data-multipledatasources/pom.xml @@ -15,7 +15,7 @@ Demo project for using multiple datasource's in a Spring Boot Application - 17 + 21 2.40.0 2.2.0 diff --git a/jpa/boot-hibernate2ndlevelcache-sample/pom.xml b/jpa/boot-hibernate2ndlevelcache-sample/pom.xml index 8b0b39857..9130bbe1d 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/pom.xml +++ b/jpa/boot-hibernate2ndlevelcache-sample/pom.xml @@ -172,29 +172,30 @@ org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - org.mapstruct - mapstruct-processor - ${org.mapstruct.version} - - - - org.projectlombok - lombok - ${lombok.version} - - - - org.projectlombok - lombok-mapstruct-binding - 0.2.0 - - + maven-compiler-plugin + + + + + + org.mapstruct + mapstruct-processor + ${org.mapstruct.version} + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.projectlombok + lombok-mapstruct-binding + 0.2.0 + + + ${java.version} diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/config/DatasourceProxyBeanPostProcessor.java b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/config/DatasourceProxyBeanPostProcessor.java index 5a9f94568..4d1f10921 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/config/DatasourceProxyBeanPostProcessor.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/config/DatasourceProxyBeanPostProcessor.java @@ -22,11 +22,11 @@ public class DatasourceProxyBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) { - if (bean instanceof DataSource && !(bean instanceof ProxyDataSource)) { + if (bean instanceof DataSource source && !(bean instanceof ProxyDataSource)) { final ProxyFactory factory = new ProxyFactory(bean); factory.setProxyTargetClass(true); - factory.addAdvice(new ProxyDataSourceInterceptor((DataSource) bean)); + factory.addAdvice(new ProxyDataSourceInterceptor(source)); return factory.getProxy(); } return bean; diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/Order.java b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/Order.java index 3e6060168..038ef15c2 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/Order.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/Order.java @@ -56,12 +56,12 @@ public final boolean equals(Object o) { if (this == o) return true; if (o == null) return false; Class oEffectiveClass = - o instanceof HibernateProxy - ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() + o instanceof HibernateProxy hp + ? hp.getHibernateLazyInitializer().getPersistentClass() : o.getClass(); Class thisEffectiveClass = - this instanceof HibernateProxy - ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() + this instanceof HibernateProxy hp + ? hp.getHibernateLazyInitializer().getPersistentClass() : this.getClass(); if (thisEffectiveClass != oEffectiveClass) return false; Order order = (Order) o; @@ -70,11 +70,8 @@ public final boolean equals(Object o) { @Override public final int hashCode() { - return this instanceof HibernateProxy - ? ((HibernateProxy) this) - .getHibernateLazyInitializer() - .getPersistentClass() - .hashCode() + return this instanceof HibernateProxy hp + ? hp.getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode(); } } diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/OrderItem.java b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/OrderItem.java index cc5f5e836..49b82c822 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/OrderItem.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/entities/OrderItem.java @@ -43,12 +43,12 @@ public final boolean equals(Object o) { if (this == o) return true; if (o == null) return false; Class oEffectiveClass = - o instanceof HibernateProxy - ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() + o instanceof HibernateProxy hp + ? hp.getHibernateLazyInitializer().getPersistentClass() : o.getClass(); Class thisEffectiveClass = - this instanceof HibernateProxy - ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() + this instanceof HibernateProxy hp + ? hp.getHibernateLazyInitializer().getPersistentClass() : this.getClass(); if (thisEffectiveClass != oEffectiveClass) return false; OrderItem orderItem = (OrderItem) o; @@ -57,11 +57,8 @@ public final boolean equals(Object o) { @Override public final int hashCode() { - return this instanceof HibernateProxy - ? ((HibernateProxy) this) - .getHibernateLazyInitializer() - .getPersistentClass() - .hashCode() + return this instanceof HibernateProxy hp + ? hp.getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode(); } } diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/CustomerControllerIT.java b/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/CustomerControllerIT.java index 4ef5491fc..9460e1117 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/CustomerControllerIT.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/CustomerControllerIT.java @@ -64,7 +64,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -118,7 +118,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setFirstName("Updated Customer"); this.mockMvc @@ -135,7 +135,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId())) diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderControllerIT.java b/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderControllerIT.java index a69b5e237..27a61f4f9 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderControllerIT.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderControllerIT.java @@ -73,7 +73,7 @@ void shouldFetchAllOrders() throws Exception { @Test void shouldFindOrderById() throws Exception { - Order order = orderList.get(0); + Order order = orderList.getFirst(); Long orderId = order.getId(); this.mockMvc @@ -134,7 +134,7 @@ void shouldUpdateOrder() throws Exception { Long customerId = savedCustomer.getId(); OrderRequest orderRequest = new OrderRequest(customerId, "Updated Order", BigDecimal.TWO); - Long orderId = orderList.get(0).getId(); + Long orderId = orderList.getFirst().getId(); this.mockMvc .perform( put("/api/orders/{id}", orderId) @@ -150,7 +150,7 @@ void shouldUpdateOrder() throws Exception { @Test void shouldDeleteOrder() throws Exception { - Order order = orderList.get(0); + Order order = orderList.getFirst(); this.mockMvc .perform(delete("/api/orders/{id}", order.getId())) diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderItemControllerIT.java b/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderItemControllerIT.java index 130764373..0c53e71f7 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderItemControllerIT.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/test/java/com/example/hibernatecache/web/controllers/OrderItemControllerIT.java @@ -78,7 +78,7 @@ void shouldFetchAllOrderItems() throws Exception { @Test void shouldFindOrderItemById() throws Exception { - OrderItem orderItem = orderItemList.get(0); + OrderItem orderItem = orderItemList.getFirst(); Long orderItemId = orderItem.getId(); this.mockMvc @@ -125,7 +125,7 @@ void shouldReturn400WhenCreateNewOrderItemWithoutText() throws Exception { @Test void shouldUpdateOrderItem() throws Exception { - OrderItem orderItem = orderItemList.get(0); + OrderItem orderItem = orderItemList.getFirst(); orderItem.setText("Updated OrderItem"); this.mockMvc @@ -140,7 +140,7 @@ void shouldUpdateOrderItem() throws Exception { @Test void shouldDeleteOrderItem() throws Exception { - OrderItem orderItem = orderItemList.get(0); + OrderItem orderItem = orderItemList.getFirst(); this.mockMvc .perform(delete("/api/order/items/{id}", orderItem.getId())) diff --git a/jpa/boot-jpa-locks/pom.xml b/jpa/boot-jpa-locks/pom.xml index 57d01fc06..b97b9d619 100644 --- a/jpa/boot-jpa-locks/pom.xml +++ b/jpa/boot-jpa-locks/pom.xml @@ -20,7 +20,7 @@ UTF-8 UTF-8 - 17 + 21 2022.0.4 2.2.0 2.15.0 diff --git a/jpa/boot-jpa-locks/src/main/java/com/example/locks/config/logging/LoggingAspect.java b/jpa/boot-jpa-locks/src/main/java/com/example/locks/config/logging/LoggingAspect.java index 7dec3ab7c..92e20a13b 100644 --- a/jpa/boot-jpa-locks/src/main/java/com/example/locks/config/logging/LoggingAspect.java +++ b/jpa/boot-jpa-locks/src/main/java/com/example/locks/config/logging/LoggingAspect.java @@ -25,15 +25,21 @@ public LoggingAspect(Environment env) { this.env = env; } - @Pointcut("within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + @Pointcut( + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } - @Pointcut("@within(com.example.locks.config.logging.Loggable) || " - + "@annotation(com.example.locks.config.logging.Loggable)") + @Pointcut( + """ + @within(com.example.locks.config.logging.Loggable) || \ + @annotation(com.example.locks.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/ActorControllerIT.java b/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/ActorControllerIT.java index faf887b14..db98172c7 100644 --- a/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/ActorControllerIT.java +++ b/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/ActorControllerIT.java @@ -58,7 +58,7 @@ void shouldFetchAllActors() throws Exception { @Test void shouldFindActorById() throws Exception { - Actor actor = actorList.get(0); + Actor actor = actorList.getFirst(); Long actorId = actor.getId(); this.mockMvc @@ -104,7 +104,7 @@ void shouldReturn400WhenCreateNewActorWithoutText() throws Exception { @Test void shouldUpdateActor() throws Exception { - Long actorId = actorList.get(0).getId(); + Long actorId = actorList.getFirst().getId(); ActorRequest actorRequest = new ActorRequest("Updated Actor"); this.mockMvc @@ -118,7 +118,7 @@ void shouldUpdateActor() throws Exception { @Test void shouldDeleteActor() throws Exception { - Actor actor = actorList.get(0); + Actor actor = actorList.getFirst(); this.mockMvc .perform(delete("/api/actors/{id}", actor.getId())) diff --git a/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/MovieControllerIT.java b/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/MovieControllerIT.java index 53c110b19..09af1154f 100644 --- a/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/MovieControllerIT.java +++ b/jpa/boot-jpa-locks/src/test/java/com/example/locks/web/controllers/MovieControllerIT.java @@ -58,7 +58,7 @@ void shouldFetchAllMovies() throws Exception { @Test void shouldFindMovieById() throws Exception { - Movie movie = movieList.get(0); + Movie movie = movieList.getFirst(); Long movieId = movie.getId(); this.mockMvc @@ -104,7 +104,7 @@ void shouldReturn400WhenCreateNewMovieWithoutText() throws Exception { @Test void shouldUpdateMovie() throws Exception { - Long movieId = movieList.get(0).getId(); + Long movieId = movieList.getFirst().getId(); MovieRequest movieRequest = new MovieRequest("Updated Movie"); this.mockMvc @@ -118,7 +118,7 @@ void shouldUpdateMovie() throws Exception { @Test void shouldDeleteMovie() throws Exception { - Movie movie = movieList.get(0); + Movie movie = movieList.getFirst(); this.mockMvc .perform(delete("/api/movies/{id}", movie.getId())) diff --git a/jpa/boot-read-replica-postgresql/pom.xml b/jpa/boot-read-replica-postgresql/pom.xml index 52935418c..043b56c3f 100644 --- a/jpa/boot-read-replica-postgresql/pom.xml +++ b/jpa/boot-read-replica-postgresql/pom.xml @@ -98,7 +98,7 @@ - + com.diffplug.spotless spotless-maven-plugin diff --git a/jpa/boot-read-replica-postgresql/src/main/java/com/example/demo/readreplica/config/routing/RoutingDataSource.java b/jpa/boot-read-replica-postgresql/src/main/java/com/example/demo/readreplica/config/routing/RoutingDataSource.java index 577340c9b..9e35188d0 100644 --- a/jpa/boot-read-replica-postgresql/src/main/java/com/example/demo/readreplica/config/routing/RoutingDataSource.java +++ b/jpa/boot-read-replica-postgresql/src/main/java/com/example/demo/readreplica/config/routing/RoutingDataSource.java @@ -23,4 +23,26 @@ public static void setReplicaRoute() { protected Object determineCurrentLookupKey() { return routeContext.get(); } + + public boolean isWrapperFor(Class iface) throws java.sql.SQLException { + // TODO Auto-generated method stub + return iface != null && iface.isAssignableFrom(this.getClass()); + } + + public T unwrap(Class iface) throws java.sql.SQLException { + // TODO Auto-generated method stub + try { + if (iface != null && iface.isAssignableFrom(this.getClass())) { + return (T) this; + } + throw new java.sql.SQLException("Auto-generated unwrap failed; Revisit implementation"); + } catch (Exception e) { + throw new java.sql.SQLException(e); + } + } + + public java.util.logging.Logger getParentLogger() { + // TODO Auto-generated method stub + return null; + } } diff --git a/jpa/multitenancy/multidatasource-multitenancy/src/main/java/com/example/multitenancy/config/multitenant/TenantRoutingDatasource.java b/jpa/multitenancy/multidatasource-multitenancy/src/main/java/com/example/multitenancy/config/multitenant/TenantRoutingDatasource.java index 25ac7d469..d5e0c5af1 100644 --- a/jpa/multitenancy/multidatasource-multitenancy/src/main/java/com/example/multitenancy/config/multitenant/TenantRoutingDatasource.java +++ b/jpa/multitenancy/multidatasource-multitenancy/src/main/java/com/example/multitenancy/config/multitenant/TenantRoutingDatasource.java @@ -35,4 +35,26 @@ public class TenantRoutingDatasource extends AbstractRoutingDataSource { protected String determineCurrentLookupKey() { return tenantIdentifierResolver.resolveCurrentTenantIdentifier(); } + + public boolean isWrapperFor(Class iface) throws java.sql.SQLException { + // TODO Auto-generated method stub + return iface != null && iface.isAssignableFrom(this.getClass()); + } + + public T unwrap(Class iface) throws java.sql.SQLException { + // TODO Auto-generated method stub + try { + if (iface != null && iface.isAssignableFrom(this.getClass())) { + return (T) this; + } + throw new java.sql.SQLException("Auto-generated unwrap failed; Revisit implementation"); + } catch (Exception e) { + throw new java.sql.SQLException(e); + } + } + + public java.util.logging.Logger getParentLogger() { + // TODO Auto-generated method stub + return null; + } } diff --git a/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/PrimaryCustomerControllerIT.java b/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/PrimaryCustomerControllerIT.java index 10980704d..fee3e064d 100644 --- a/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/PrimaryCustomerControllerIT.java +++ b/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/PrimaryCustomerControllerIT.java @@ -73,7 +73,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - PrimaryCustomer primaryCustomer = primaryCustomerList.get(0); + PrimaryCustomer primaryCustomer = primaryCustomerList.getFirst(); Long customerId = primaryCustomer.getId(); this.mockMvc @@ -125,7 +125,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - PrimaryCustomer primaryCustomer = primaryCustomerList.get(0); + PrimaryCustomer primaryCustomer = primaryCustomerList.getFirst(); primaryCustomer.setText("Updated Customer"); this.mockMvc @@ -141,7 +141,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - PrimaryCustomer primaryCustomer = primaryCustomerList.get(0); + PrimaryCustomer primaryCustomer = primaryCustomerList.getFirst(); this.mockMvc .perform( diff --git a/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/SecondaryCustomerControllerIT.java b/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/SecondaryCustomerControllerIT.java index f1fb36acc..a3362baec 100644 --- a/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/SecondaryCustomerControllerIT.java +++ b/jpa/multitenancy/multidatasource-multitenancy/src/test/java/com/example/multitenancy/web/controllers/SecondaryCustomerControllerIT.java @@ -73,7 +73,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - SecondaryCustomer secondaryCustomer = secondaryCustomerList.get(0); + SecondaryCustomer secondaryCustomer = secondaryCustomerList.getFirst(); Long customerId = secondaryCustomer.getId(); this.mockMvc @@ -129,7 +129,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutName() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - SecondaryCustomer secondaryCustomer = secondaryCustomerList.get(0); + SecondaryCustomer secondaryCustomer = secondaryCustomerList.getFirst(); secondaryCustomer.setName("Updated Customer"); this.mockMvc @@ -144,7 +144,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - SecondaryCustomer secondaryCustomer = secondaryCustomerList.get(0); + SecondaryCustomer secondaryCustomer = secondaryCustomerList.getFirst(); this.mockMvc .perform( diff --git a/jpa/multitenancy/multitenancy-db/pom.xml b/jpa/multitenancy/multitenancy-db/pom.xml index e6db79fc1..26419a1c6 100644 --- a/jpa/multitenancy/multitenancy-db/pom.xml +++ b/jpa/multitenancy/multitenancy-db/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 ${project.build.directory}/test-results diff --git a/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/logging/LoggingAspect.java b/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/logging/LoggingAspect.java index a02408836..b0df52cf8 100644 --- a/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/logging/LoggingAspect.java +++ b/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.multitenancy.db.config.logging.Loggable) || " - + "@annotation(com.example.multitenancy.db.config.logging.Loggable)") + """ + @within(com.example.multitenancy.db.config.logging.Loggable) || \ + @annotation(com.example.multitenancy.db.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/multitenant/TenantRoutingDatasource.java b/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/multitenant/TenantRoutingDatasource.java index 7f38a1d15..a257c0228 100644 --- a/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/multitenant/TenantRoutingDatasource.java +++ b/jpa/multitenancy/multitenancy-db/src/main/java/com/example/multitenancy/db/config/multitenant/TenantRoutingDatasource.java @@ -29,4 +29,26 @@ public class TenantRoutingDatasource extends AbstractRoutingDataSource { protected String determineCurrentLookupKey() { return tenantIdentifierResolver.resolveCurrentTenantIdentifier(); } + + public boolean isWrapperFor(Class iface) throws java.sql.SQLException { + // TODO Auto-generated method stub + return iface != null && iface.isAssignableFrom(this.getClass()); + } + + public T unwrap(Class iface) throws java.sql.SQLException { + // TODO Auto-generated method stub + try { + if (iface != null && iface.isAssignableFrom(this.getClass())) { + return (T) this; + } + throw new java.sql.SQLException("Auto-generated unwrap failed; Revisit implementation"); + } catch (Exception e) { + throw new java.sql.SQLException(e); + } + } + + public java.util.logging.Logger getParentLogger() { + // TODO Auto-generated method stub + return null; + } } diff --git a/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/web/controllers/CustomerControllerIT.java b/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/web/controllers/CustomerControllerIT.java index cd877bb01..85d33cb8d 100644 --- a/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/web/controllers/CustomerControllerIT.java +++ b/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/web/controllers/CustomerControllerIT.java @@ -68,7 +68,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -112,7 +112,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setText("Updated Customer"); this.mockMvc @@ -127,7 +127,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform( diff --git a/jpa/multitenancy/partition/pom.xml b/jpa/multitenancy/partition/pom.xml index 90a4f3cb5..cca078871 100644 --- a/jpa/multitenancy/partition/pom.xml +++ b/jpa/multitenancy/partition/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 ${project.build.directory}/test-results diff --git a/jpa/multitenancy/partition/src/main/java/com/example/multitenancy/partition/config/logging/LoggingAspect.java b/jpa/multitenancy/partition/src/main/java/com/example/multitenancy/partition/config/logging/LoggingAspect.java index bee513f9c..6df531057 100644 --- a/jpa/multitenancy/partition/src/main/java/com/example/multitenancy/partition/config/logging/LoggingAspect.java +++ b/jpa/multitenancy/partition/src/main/java/com/example/multitenancy/partition/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.multitenancy.partition.config.logging.Loggable) || " - + "@annotation(com.example.multitenancy.partition.config.logging.Loggable)") + """ + @within(com.example.multitenancy.partition.config.logging.Loggable) || \ + @annotation(com.example.multitenancy.partition.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jpa/multitenancy/partition/src/test/java/com/example/multitenancy/partition/web/controllers/CustomerControllerIT.java b/jpa/multitenancy/partition/src/test/java/com/example/multitenancy/partition/web/controllers/CustomerControllerIT.java index 81ef67ec1..3292658de 100644 --- a/jpa/multitenancy/partition/src/test/java/com/example/multitenancy/partition/web/controllers/CustomerControllerIT.java +++ b/jpa/multitenancy/partition/src/test/java/com/example/multitenancy/partition/web/controllers/CustomerControllerIT.java @@ -54,7 +54,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -102,7 +102,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); customer.setText("Updated Customer"); this.mockMvc @@ -117,7 +117,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); long count = this.customerRepository.countByTenant("dbsystc"); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId()).param("tenant", "dbsystc")) diff --git a/jpa/multitenancy/schema/pom.xml b/jpa/multitenancy/schema/pom.xml index 200391fb7..acd95c881 100644 --- a/jpa/multitenancy/schema/pom.xml +++ b/jpa/multitenancy/schema/pom.xml @@ -18,7 +18,7 @@ UTF-8 UTF-8 - 17 + 21 2.2.0 ${project.build.directory}/test-results @@ -175,8 +175,8 @@ org.apache.maven.plugins maven-compiler-plugin - ${java.version} - ${java.version} + + org.mapstruct @@ -196,6 +196,7 @@ 0.2.0 + ${java.version} diff --git a/jpa/multitenancy/schema/src/main/java/com/example/multitenancy/schema/config/logging/LoggingAspect.java b/jpa/multitenancy/schema/src/main/java/com/example/multitenancy/schema/config/logging/LoggingAspect.java index f2e4275d6..c8cf7886b 100644 --- a/jpa/multitenancy/schema/src/main/java/com/example/multitenancy/schema/config/logging/LoggingAspect.java +++ b/jpa/multitenancy/schema/src/main/java/com/example/multitenancy/schema/config/logging/LoggingAspect.java @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) { } @Pointcut( - "within(@org.springframework.stereotype.Repository *)" - + " || within(@org.springframework.stereotype.Service *)" - + " || within(@org.springframework.web.bind.annotation.RestController *)") + """ + within(@org.springframework.stereotype.Repository *)\ + || within(@org.springframework.stereotype.Service *)\ + || within(@org.springframework.web.bind.annotation.RestController *)\ + """) public void springBeanPointcut() { // pointcut definition } @Pointcut( - "@within(com.example.multitenancy.schema.config.logging.Loggable) || " - + "@annotation(com.example.multitenancy.schema.config.logging.Loggable)") + """ + @within(com.example.multitenancy.schema.config.logging.Loggable) || \ + @annotation(com.example.multitenancy.schema.config.logging.Loggable)\ + """) public void applicationPackagePointcut() { // pointcut definition } diff --git a/jpa/multitenancy/schema/src/test/java/com/example/multitenancy/schema/web/controllers/CustomerControllerIT.java b/jpa/multitenancy/schema/src/test/java/com/example/multitenancy/schema/web/controllers/CustomerControllerIT.java index 788cee9ab..a0c1005a0 100644 --- a/jpa/multitenancy/schema/src/test/java/com/example/multitenancy/schema/web/controllers/CustomerControllerIT.java +++ b/jpa/multitenancy/schema/src/test/java/com/example/multitenancy/schema/web/controllers/CustomerControllerIT.java @@ -54,7 +54,7 @@ void shouldFetchAllCustomers() throws Exception { @Test void shouldFindCustomerById() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); Long customerId = customer.getId(); this.mockMvc @@ -102,7 +102,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutName() throws Exception { @Test void shouldUpdateCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); CustomerDto customerDto = new CustomerDto("Updated Customer"); this.mockMvc @@ -125,7 +125,7 @@ void shouldUpdateCustomer() throws Exception { @Test void shouldDeleteCustomer() throws Exception { - Customer customer = customerList.get(0); + Customer customer = customerList.getFirst(); this.mockMvc .perform(delete("/api/customers/{id}", customer.getId()).param("tenant", "test1")) diff --git a/open-api-spring-boot/pom.xml b/open-api-spring-boot/pom.xml index 3cde37bae..3e6074187 100644 --- a/open-api-spring-boot/pom.xml +++ b/open-api-spring-boot/pom.xml @@ -14,8 +14,8 @@ 0.0.1-SNAPSHOT - 17 - 17 + 21 + 21 UTF-8 2022.0.4 7.1.0 diff --git a/r2dbc/boot-jooq-r2dbc-sample/pom.xml b/r2dbc/boot-jooq-r2dbc-sample/pom.xml index 28e817b29..e2a8d5aa9 100644 --- a/r2dbc/boot-jooq-r2dbc-sample/pom.xml +++ b/r2dbc/boot-jooq-r2dbc-sample/pom.xml @@ -53,6 +53,11 @@ org.springframework.boot spring-boot-starter-webflux + + org.glassfish.jaxb + jaxb-runtime + provided + org.springframework.boot spring-boot-starter-aop diff --git a/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/repository/custom/impl/JooqSorting.java b/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/repository/custom/impl/JooqSorting.java index 7688dc6a2..ad38ee98c 100644 --- a/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/repository/custom/impl/JooqSorting.java +++ b/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/repository/custom/impl/JooqSorting.java @@ -37,7 +37,7 @@ private TableField getTableField(String sortFieldName, T tableType) { tableType.getClass().getField(sortFieldName.toUpperCase(Locale.ROOT)); sortField = (TableField) tableField.get(tableType); } catch (NoSuchFieldException | IllegalAccessException ex) { - String errorMessage = String.format("Could not find table field: %s", sortFieldName); + String errorMessage = "Could not find table field: %s".formatted(sortFieldName); throw new InvalidDataAccessApiUsageException(errorMessage, ex); } return sortField; diff --git a/r2dbc/boot-r2dbc-sample/pom.xml b/r2dbc/boot-r2dbc-sample/pom.xml index 59dfbf8e5..575d4a174 100644 --- a/r2dbc/boot-r2dbc-sample/pom.xml +++ b/r2dbc/boot-r2dbc-sample/pom.xml @@ -39,32 +39,37 @@ ${jacoco.itReportFolder}/integrationTest.exec ${project.testresult.directory}/test ${project.testresult.directory}/integrationTest - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-aop - - - org.springframework.boot - spring-boot-starter-data-r2dbc - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.boot - spring-boot-starter-webflux + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-data-r2dbc + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-webflux + + + org.glassfish.jaxb + jaxb-runtime + provided org.liquibase @@ -178,42 +183,43 @@ org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - org.mapstruct - mapstruct-processor - ${org.mapstruct.version} - - - - org.projectlombok - lombok - ${lombok.version} - - - - org.projectlombok - lombok-mapstruct-binding - 0.2.0 - - - - true - - + maven-compiler-plugin + + + + + + org.mapstruct + mapstruct-processor + ${org.mapstruct.version} + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.projectlombok + lombok-mapstruct-binding + 0.2.0 + + + + true + + -Amapstruct.suppressGeneratorTimestamp=true - - + + -Amapstruct.suppressGeneratorVersionInfoComment=true - - + + -Amapstruct.verbose=true - - + + + ${java.version} diff --git a/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerIT.java b/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerIT.java index eaff513a8..54110ed8d 100644 --- a/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerIT.java +++ b/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerIT.java @@ -92,7 +92,7 @@ void shouldFetchAllReactiveComments() { .uri( uriBuilder -> { uriBuilder.queryParam( - "postId", expectedPostComments.get(0).getPostId()); + "postId", expectedPostComments.getFirst().getPostId()); uriBuilder.queryParam("sortBy", "title"); uriBuilder.path("/api/posts/comments/"); return uriBuilder.build(); diff --git a/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerTest.java b/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerTest.java index 7bd27f535..d48866fbc 100644 --- a/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerTest.java +++ b/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/web/controllers/ReactiveCommentsControllerTest.java @@ -79,7 +79,7 @@ void shouldFetchAllReactiveComments() { .uri( uriBuilder -> { uriBuilder.queryParam( - "postId", expectedCommentsList.get(0).getPostId()); + "postId", expectedCommentsList.getFirst().getPostId()); uriBuilder.queryParam("sortBy", "title"); uriBuilder.path("/api/posts/comments/"); return uriBuilder.build();