From 60a83ce747dac65c6f430d7fac187c383b09e520 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Sat, 31 Aug 2024 07:21:56 +0000 Subject: [PATCH 1/5] feat : apply spring boot best practices --- batch-boot-jpa-sample/Dockerfile | 2 +- boot-api-archunit-sample/Dockerfile | 2 +- boot-choas-monkey/Dockerfile | 2 +- .../src/main/resources/application.properties | 3 ++- .../GrafanaLGTMApplicationTest.java | 2 +- boot-mongodb-elasticsearch/Dockerfile | 2 +- boot-opensearch-sample/Dockerfile | 2 +- boot-rest-docs-sample/Dockerfile | 2 +- boot-togglz-sample/Dockerfile | 2 +- .../config/RedisValueOperationsUtil.java | 2 -- .../controller/RedisController.java | 3 +-- graphql/boot-graphql-querydsl/Dockerfile | 2 +- graphql/boot-graphql-webflux/Dockerfile | 2 +- graphql/boot-graphql-webmvc/Dockerfile | 2 +- httpClients/boot-http-proxy/Dockerfile | 2 +- httpClients/boot-rest-template/Dockerfile | 2 +- httpClients/boot-web-client-mvc/Dockerfile | 2 +- .../boot-web-client-webflux/Dockerfile | 2 +- jpa/boot-data-customsequence/Dockerfile | 2 +- jpa/boot-data-envers/Dockerfile | 2 +- .../web/controllers/CustomerControllerIT.java | 4 ++-- jpa/boot-data-keyset-pagination/Dockerfile | 2 +- .../Dockerfile | 2 +- .../web/controllers/CustomerController.java | 12 ++++------ .../web/controllers/OrderController.java | 12 ++++------ .../web/controllers/OrderItemController.java | 12 ++++------ jpa/boot-jndi-sample/Dockerfile | 2 +- .../web/controllers/DriverController.java | 12 ++++------ .../src/main/resources/application.properties | 1 + .../web/controllers/DriverControllerIT.java | 6 ++--- jpa/boot-jpa-locks/Dockerfile | 2 +- .../config/routing/RoutingDataSource.java | 22 +++++++++++++++++++ .../multidatasource-multitenancy/Dockerfile | 2 +- .../multitenant/TenantRoutingDatasource.java | 22 +++++++++++++++++++ jpa/multitenancy/multitenancy-db/Dockerfile | 2 +- jpa/multitenancy/multitenancy-db/pom.xml | 6 +++++ .../multitenant/TenantRoutingDatasource.java | 22 +++++++++++++++++++ jpa/multitenancy/partition/Dockerfile | 2 +- jpa/multitenancy/schema/Dockerfile | 2 +- open-api-spring-boot/pom.xml | 2 -- pom.xml | 1 + r2dbc/boot-jooq-r2dbc-sample/Dockerfile | 2 +- r2dbc/boot-r2dbc-reactive-cache/Dockerfile | 2 +- r2dbc/boot-r2dbc-reactive-cache/pom.xml | 6 +++++ .../example/cache/services/MovieService.java | 2 -- .../src/main/resources/application.properties | 3 ++- r2dbc/boot-r2dbc-sample/Dockerfile | 2 +- scheduler/boot-scheduler-jobrunr/Dockerfile | 2 +- scheduler/boot-scheduler-quartz/Dockerfile | 2 +- scheduler/boot-scheduler-shedlock/Dockerfile | 2 +- .../src/main/resources/application.properties | 1 + 51 files changed, 138 insertions(+), 78 deletions(-) diff --git a/batch-boot-jpa-sample/Dockerfile b/batch-boot-jpa-sample/Dockerfile index 0d7d1b5a5..d462cbbf3 100644 --- a/batch-boot-jpa-sample/Dockerfile +++ b/batch-boot-jpa-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-api-archunit-sample/Dockerfile b/boot-api-archunit-sample/Dockerfile index cac62f417..1d48a2c5c 100644 --- a/boot-api-archunit-sample/Dockerfile +++ b/boot-api-archunit-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-choas-monkey/Dockerfile b/boot-choas-monkey/Dockerfile index 22c35da42..d40678de0 100644 --- a/boot-choas-monkey/Dockerfile +++ b/boot-choas-monkey/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-grafana-lgtm/src/main/resources/application.properties b/boot-grafana-lgtm/src/main/resources/application.properties index 91bb860de..419f5c5a0 100644 --- a/boot-grafana-lgtm/src/main/resources/application.properties +++ b/boot-grafana-lgtm/src/main/resources/application.properties @@ -1,4 +1,5 @@ -spring.application.name=boot-grafana-lgtm +spring.application.name=boot-grafana-lgtm +spring.threads.virtual.enabled=true management.endpoints.web.exposure.include=env,health,info,logfile,loggers,metrics,prometheus management.tracing.sampling.probability=1.0 diff --git a/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java b/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java index ffa181f13..96d0ff8a2 100644 --- a/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java +++ b/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java @@ -8,7 +8,7 @@ import io.restassured.RestAssured; import io.restassured.authentication.PreemptiveBasicAuthScheme; import io.restassured.http.ContentType; -import org.apache.http.HttpStatus; +import org.apache.hc.core5.http.HttpStatus; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/boot-mongodb-elasticsearch/Dockerfile b/boot-mongodb-elasticsearch/Dockerfile index b27f447d6..562c77fbb 100644 --- a/boot-mongodb-elasticsearch/Dockerfile +++ b/boot-mongodb-elasticsearch/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-opensearch-sample/Dockerfile b/boot-opensearch-sample/Dockerfile index f34ce21f3..742ed8357 100644 --- a/boot-opensearch-sample/Dockerfile +++ b/boot-opensearch-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-rest-docs-sample/Dockerfile b/boot-rest-docs-sample/Dockerfile index 798a41c6f..93a154138 100644 --- a/boot-rest-docs-sample/Dockerfile +++ b/boot-rest-docs-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-togglz-sample/Dockerfile b/boot-togglz-sample/Dockerfile index 350287492..75cfe66a9 100644 --- a/boot-togglz-sample/Dockerfile +++ b/boot-togglz-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/boot-ultimate-redis/src/main/java/com/example/ultimateredis/config/RedisValueOperationsUtil.java b/boot-ultimate-redis/src/main/java/com/example/ultimateredis/config/RedisValueOperationsUtil.java index 20735b331..443ccb4e9 100644 --- a/boot-ultimate-redis/src/main/java/com/example/ultimateredis/config/RedisValueOperationsUtil.java +++ b/boot-ultimate-redis/src/main/java/com/example/ultimateredis/config/RedisValueOperationsUtil.java @@ -1,7 +1,6 @@ package com.example.ultimateredis.config; import java.util.concurrent.TimeUnit; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Component; @@ -12,7 +11,6 @@ public class RedisValueOperationsUtil { private final RedisTemplate redisTemplate; private final ValueOperations valueOperations; - @Autowired public RedisValueOperationsUtil(RedisTemplate redisTemplate) { this.redisTemplate = redisTemplate; this.valueOperations = redisTemplate.opsForValue(); diff --git a/boot-ultimate-redis/src/main/java/com/example/ultimateredis/controller/RedisController.java b/boot-ultimate-redis/src/main/java/com/example/ultimateredis/controller/RedisController.java index 8e625a770..f9e60baf1 100644 --- a/boot-ultimate-redis/src/main/java/com/example/ultimateredis/controller/RedisController.java +++ b/boot-ultimate-redis/src/main/java/com/example/ultimateredis/controller/RedisController.java @@ -31,8 +31,7 @@ public ResponseEntity> addRedisKeyValue( } @GetMapping - public ResponseEntity> getFromCache( - @RequestParam(value = "key") String key) { + public ResponseEntity> getFromCache(@RequestParam String key) { String value = redisService.getValue(key); return ResponseEntity.ok(new GenericResponse<>(value)); diff --git a/graphql/boot-graphql-querydsl/Dockerfile b/graphql/boot-graphql-querydsl/Dockerfile index c0642da33..a45c977df 100644 --- a/graphql/boot-graphql-querydsl/Dockerfile +++ b/graphql/boot-graphql-querydsl/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/graphql/boot-graphql-webflux/Dockerfile b/graphql/boot-graphql-webflux/Dockerfile index 49a8afe77..313dabc8a 100644 --- a/graphql/boot-graphql-webflux/Dockerfile +++ b/graphql/boot-graphql-webflux/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/graphql/boot-graphql-webmvc/Dockerfile b/graphql/boot-graphql-webmvc/Dockerfile index 4967b5e42..e13ce7442 100644 --- a/graphql/boot-graphql-webmvc/Dockerfile +++ b/graphql/boot-graphql-webmvc/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/httpClients/boot-http-proxy/Dockerfile b/httpClients/boot-http-proxy/Dockerfile index 7bd19c96f..431faa26a 100644 --- a/httpClients/boot-http-proxy/Dockerfile +++ b/httpClients/boot-http-proxy/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/httpClients/boot-rest-template/Dockerfile b/httpClients/boot-rest-template/Dockerfile index 8ab59ef98..17054d160 100644 --- a/httpClients/boot-rest-template/Dockerfile +++ b/httpClients/boot-rest-template/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/httpClients/boot-web-client-mvc/Dockerfile b/httpClients/boot-web-client-mvc/Dockerfile index 24e8f8a01..cea4228a6 100644 --- a/httpClients/boot-web-client-mvc/Dockerfile +++ b/httpClients/boot-web-client-mvc/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/httpClients/boot-web-client-webflux/Dockerfile b/httpClients/boot-web-client-webflux/Dockerfile index 3163cd76f..b931fe5b3 100644 --- a/httpClients/boot-web-client-webflux/Dockerfile +++ b/httpClients/boot-web-client-webflux/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/boot-data-customsequence/Dockerfile b/jpa/boot-data-customsequence/Dockerfile index 059f5f5c5..d7bc26ec0 100644 --- a/jpa/boot-data-customsequence/Dockerfile +++ b/jpa/boot-data-customsequence/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/boot-data-envers/Dockerfile b/jpa/boot-data-envers/Dockerfile index cd6dfe19c..f24108043 100644 --- a/jpa/boot-data-envers/Dockerfile +++ b/jpa/boot-data-envers/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] 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 be24d54d4..d7b2dcd06 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 @@ -13,8 +13,8 @@ import io.restassured.http.ContentType; import java.util.ArrayList; import java.util.List; -import org.apache.http.HttpHeaders; -import org.apache.http.HttpStatus; +import org.apache.hc.core5.http.HttpHeaders; +import org.apache.hc.core5.http.HttpStatus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/jpa/boot-data-keyset-pagination/Dockerfile b/jpa/boot-data-keyset-pagination/Dockerfile index 42805f83a..083f9bacd 100644 --- a/jpa/boot-data-keyset-pagination/Dockerfile +++ b/jpa/boot-data-keyset-pagination/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/boot-hibernate2ndlevelcache-sample/Dockerfile b/jpa/boot-hibernate2ndlevelcache-sample/Dockerfile index ca1e571b2..3b0111906 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/Dockerfile +++ b/jpa/boot-hibernate2ndlevelcache-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/CustomerController.java b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/CustomerController.java index c49ade6d9..c2c8dd6eb 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/CustomerController.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/CustomerController.java @@ -34,14 +34,10 @@ class CustomerController { @GetMapping PagedResult getAllCustomers( - @RequestParam(value = "pageNo", defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) - int pageNo, - @RequestParam(value = "pageSize", defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) - int pageSize, - @RequestParam(value = "sortBy", defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) - String sortBy, - @RequestParam(value = "sortDir", defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) - String sortDir) { + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) int pageNo, + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) int pageSize, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) String sortBy, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) String sortDir) { FindCustomersQuery findCustomersQuery = new FindCustomersQuery(pageNo, pageSize, sortBy, sortDir); return customerService.findAllCustomers(findCustomersQuery); } diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderController.java b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderController.java index feb9ccc8e..5759c022e 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderController.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderController.java @@ -34,14 +34,10 @@ class OrderController { @GetMapping PagedResult getAllOrders( - @RequestParam(value = "pageNo", defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) - int pageNo, - @RequestParam(value = "pageSize", defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) - int pageSize, - @RequestParam(value = "sortBy", defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) - String sortBy, - @RequestParam(value = "sortDir", defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) - String sortDir) { + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) int pageNo, + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) int pageSize, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) String sortBy, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) String sortDir) { FindOrdersQuery findOrdersQuery = new FindOrdersQuery(pageNo, pageSize, sortBy, sortDir); return orderService.findAllOrders(findOrdersQuery); } diff --git a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderItemController.java b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderItemController.java index 73bf42267..e446cbf7d 100644 --- a/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderItemController.java +++ b/jpa/boot-hibernate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/web/controllers/OrderItemController.java @@ -34,14 +34,10 @@ class OrderItemController { @GetMapping PagedResult getAllOrderItems( - @RequestParam(value = "pageNo", defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) - int pageNo, - @RequestParam(value = "pageSize", defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) - int pageSize, - @RequestParam(value = "sortBy", defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) - String sortBy, - @RequestParam(value = "sortDir", defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) - String sortDir) { + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) int pageNo, + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) int pageSize, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) String sortBy, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) String sortDir) { FindOrderItemsQuery findOrderItemsQuery = new FindOrderItemsQuery(pageNo, pageSize, sortBy, sortDir); return orderItemService.findAllOrderItems(findOrderItemsQuery); } diff --git a/jpa/boot-jndi-sample/Dockerfile b/jpa/boot-jndi-sample/Dockerfile index 383fed4d4..d805c22b6 100644 --- a/jpa/boot-jndi-sample/Dockerfile +++ b/jpa/boot-jndi-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/boot-jndi-sample/src/main/java/com/example/jndi/web/controllers/DriverController.java b/jpa/boot-jndi-sample/src/main/java/com/example/jndi/web/controllers/DriverController.java index d4454d3cd..05fb99d57 100644 --- a/jpa/boot-jndi-sample/src/main/java/com/example/jndi/web/controllers/DriverController.java +++ b/jpa/boot-jndi-sample/src/main/java/com/example/jndi/web/controllers/DriverController.java @@ -34,14 +34,10 @@ public class DriverController { @GetMapping public PagedResult getAllDrivers( - @RequestParam(value = "pageNo", defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) - int pageNo, - @RequestParam(value = "pageSize", defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) - int pageSize, - @RequestParam(value = "sortBy", defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) - String sortBy, - @RequestParam(value = "sortDir", defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) - String sortDir) { + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_NUMBER, required = false) int pageNo, + @RequestParam(defaultValue = AppConstants.DEFAULT_PAGE_SIZE, required = false) int pageSize, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_BY, required = false) String sortBy, + @RequestParam(defaultValue = AppConstants.DEFAULT_SORT_DIRECTION, required = false) String sortDir) { FindDriversQuery findDriversQuery = new FindDriversQuery(pageNo, pageSize, sortBy, sortDir); return driverService.findAllDrivers(findDriversQuery); } diff --git a/jpa/boot-jndi-sample/src/main/resources/application.properties b/jpa/boot-jndi-sample/src/main/resources/application.properties index b810bfb19..eb760bedf 100644 --- a/jpa/boot-jndi-sample/src/main/resources/application.properties +++ b/jpa/boot-jndi-sample/src/main/resources/application.properties @@ -4,6 +4,7 @@ server.shutdown=graceful spring.main.allow-bean-definition-overriding=true spring.jmx.enabled=false spring.mvc.problemdetails.enabled=true +spring.threads.virtual.enabled=true ################ Actuator ##################### management.endpoints.web.exposure.include=configprops,env,health,info,logfile,loggers,metrics,prometheus diff --git a/jpa/boot-jndi-sample/src/test/java/com/example/jndi/web/controllers/DriverControllerIT.java b/jpa/boot-jndi-sample/src/test/java/com/example/jndi/web/controllers/DriverControllerIT.java index 90f2ab4f2..306c2177e 100644 --- a/jpa/boot-jndi-sample/src/test/java/com/example/jndi/web/controllers/DriverControllerIT.java +++ b/jpa/boot-jndi-sample/src/test/java/com/example/jndi/web/controllers/DriverControllerIT.java @@ -58,7 +58,7 @@ void shouldFetchAllDrivers() throws Exception { @Test void shouldFindDriverById() throws Exception { - Driver driver = driverList.get(0); + Driver driver = driverList.getFirst(); Long driverId = driver.getId(); this.mockMvc @@ -104,7 +104,7 @@ void shouldReturn400WhenCreateNewDriverWithoutText() throws Exception { @Test void shouldUpdateDriver() throws Exception { - Long driverId = driverList.get(0).getId(); + Long driverId = driverList.getFirst().getId(); DriverRequest driverRequest = new DriverRequest("Updated Driver"); this.mockMvc @@ -118,7 +118,7 @@ void shouldUpdateDriver() throws Exception { @Test void shouldDeleteDriver() throws Exception { - Driver driver = driverList.get(0); + Driver driver = driverList.getFirst(); this.mockMvc .perform(delete("/api/drivers/{id}", driver.getId())) diff --git a/jpa/boot-jpa-locks/Dockerfile b/jpa/boot-jpa-locks/Dockerfile index 77981e629..00d20568f 100644 --- a/jpa/boot-jpa-locks/Dockerfile +++ b/jpa/boot-jpa-locks/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] 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/Dockerfile b/jpa/multitenancy/multidatasource-multitenancy/Dockerfile index 365c0cee5..771d0c237 100644 --- a/jpa/multitenancy/multidatasource-multitenancy/Dockerfile +++ b/jpa/multitenancy/multidatasource-multitenancy/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] 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 191a915e6..25bb466d6 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 @@ -37,4 +37,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/Dockerfile b/jpa/multitenancy/multitenancy-db/Dockerfile index d75adfa94..2c62e1a44 100644 --- a/jpa/multitenancy/multitenancy-db/Dockerfile +++ b/jpa/multitenancy/multitenancy-db/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/multitenancy/multitenancy-db/pom.xml b/jpa/multitenancy/multitenancy-db/pom.xml index 691a03d97..4cc4661f2 100644 --- a/jpa/multitenancy/multitenancy-db/pom.xml +++ b/jpa/multitenancy/multitenancy-db/pom.xml @@ -92,6 +92,12 @@ org.testcontainers junit-jupiter test + + + junit + junit + + org.testcontainers 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 6038c43e3..102e794d0 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 @@ -31,4 +31,26 @@ 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/partition/Dockerfile b/jpa/multitenancy/partition/Dockerfile index fefa6eb09..612280121 100644 --- a/jpa/multitenancy/partition/Dockerfile +++ b/jpa/multitenancy/partition/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/jpa/multitenancy/schema/Dockerfile b/jpa/multitenancy/schema/Dockerfile index 1110d53a6..11474ed7f 100644 --- a/jpa/multitenancy/schema/Dockerfile +++ b/jpa/multitenancy/schema/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/open-api-spring-boot/pom.xml b/open-api-spring-boot/pom.xml index bfb494ae2..2833d04bc 100644 --- a/open-api-spring-boot/pom.xml +++ b/open-api-spring-boot/pom.xml @@ -81,14 +81,12 @@ jakarta.xml.bind jakarta.xml.bind-api - 2.3.3 org.glassfish.jaxb jaxb-runtime - 2.3.9 diff --git a/pom.xml b/pom.xml index b062981d1..5a934d2e3 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ pom + 21 rajadilipkolli https://sonarcloud.io diff --git a/r2dbc/boot-jooq-r2dbc-sample/Dockerfile b/r2dbc/boot-jooq-r2dbc-sample/Dockerfile index 8ffbcb594..eb44cb542 100644 --- a/r2dbc/boot-jooq-r2dbc-sample/Dockerfile +++ b/r2dbc/boot-jooq-r2dbc-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/r2dbc/boot-r2dbc-reactive-cache/Dockerfile b/r2dbc/boot-r2dbc-reactive-cache/Dockerfile index ad86a4213..95ead318d 100644 --- a/r2dbc/boot-r2dbc-reactive-cache/Dockerfile +++ b/r2dbc/boot-r2dbc-reactive-cache/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/r2dbc/boot-r2dbc-reactive-cache/pom.xml b/r2dbc/boot-r2dbc-reactive-cache/pom.xml index fc17bd97f..cc62c4cd0 100644 --- a/r2dbc/boot-r2dbc-reactive-cache/pom.xml +++ b/r2dbc/boot-r2dbc-reactive-cache/pom.xml @@ -153,6 +153,12 @@ com.redis testcontainers-redis 2.2.2 + + + junit + junit + + diff --git a/r2dbc/boot-r2dbc-reactive-cache/src/main/java/com/example/cache/services/MovieService.java b/r2dbc/boot-r2dbc-reactive-cache/src/main/java/com/example/cache/services/MovieService.java index 5bbfb2d24..343b17e12 100644 --- a/r2dbc/boot-r2dbc-reactive-cache/src/main/java/com/example/cache/services/MovieService.java +++ b/r2dbc/boot-r2dbc-reactive-cache/src/main/java/com/example/cache/services/MovieService.java @@ -6,7 +6,6 @@ import com.example.cache.model.response.MovieResponse; import com.example.cache.repositories.MovieRepository; import com.example.cache.utils.AppConstants; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.ReactiveRedisTemplate; import org.springframework.data.redis.core.ReactiveValueOperations; import org.springframework.stereotype.Service; @@ -24,7 +23,6 @@ public class MovieService { private final ReactiveRedisTemplate reactiveRedisTemplate; private final ReactiveValueOperations stringMovieReactiveValueOperations; - @Autowired public MovieService( MovieRepository movieRepository, MovieMapper movieMapper, diff --git a/r2dbc/boot-r2dbc-reactive-cache/src/main/resources/application.properties b/r2dbc/boot-r2dbc-reactive-cache/src/main/resources/application.properties index 78158ff40..2b7a7daac 100644 --- a/r2dbc/boot-r2dbc-reactive-cache/src/main/resources/application.properties +++ b/r2dbc/boot-r2dbc-reactive-cache/src/main/resources/application.properties @@ -1,5 +1,6 @@ spring.application.name=boot-r2dbc-reactive-cache -spring.jmx.enabled=false +spring.jmx.enabled=false +spring.threads.virtual.enabled=true spring.webflux.problemdetails.enabled=true server.port=8080 diff --git a/r2dbc/boot-r2dbc-sample/Dockerfile b/r2dbc/boot-r2dbc-sample/Dockerfile index 6bbca1b78..74fc7a08a 100644 --- a/r2dbc/boot-r2dbc-sample/Dockerfile +++ b/r2dbc/boot-r2dbc-sample/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/scheduler/boot-scheduler-jobrunr/Dockerfile b/scheduler/boot-scheduler-jobrunr/Dockerfile index ae3c61635..a9e79e4c4 100644 --- a/scheduler/boot-scheduler-jobrunr/Dockerfile +++ b/scheduler/boot-scheduler-jobrunr/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/scheduler/boot-scheduler-quartz/Dockerfile b/scheduler/boot-scheduler-quartz/Dockerfile index 12cd2e2cd..ed28a9b5b 100644 --- a/scheduler/boot-scheduler-quartz/Dockerfile +++ b/scheduler/boot-scheduler-quartz/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/scheduler/boot-scheduler-shedlock/Dockerfile b/scheduler/boot-scheduler-shedlock/Dockerfile index 5b865864f..43ca57e79 100644 --- a/scheduler/boot-scheduler-shedlock/Dockerfile +++ b/scheduler/boot-scheduler-shedlock/Dockerfile @@ -11,4 +11,4 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] diff --git a/scheduler/boot-scheduler-shedlock/src/main/resources/application.properties b/scheduler/boot-scheduler-shedlock/src/main/resources/application.properties index 72e3f2ab4..2ff4900b1 100644 --- a/scheduler/boot-scheduler-shedlock/src/main/resources/application.properties +++ b/scheduler/boot-scheduler-shedlock/src/main/resources/application.properties @@ -4,6 +4,7 @@ server.shutdown=graceful spring.main.allow-bean-definition-overriding=true spring.jmx.enabled=false spring.mvc.problemdetails.enabled=true +spring.threads.virtual.enabled=true ################ Actuator ##################### management.endpoints.web.exposure.include=configprops,env,health,info,logfile,loggers,metrics,prometheus From 7ca60539cd08b28da7b3ce4fd62f288587ff10a9 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Sat, 31 Aug 2024 07:29:32 +0000 Subject: [PATCH 2/5] fix : failures --- .../learning/grafanalgtm/GrafanaLGTMApplicationTest.java | 2 +- .../envers/web/controllers/CustomerControllerIT.java | 4 ++-- jpa/multitenancy/multitenancy-db/pom.xml | 6 ------ .../multitenancy/db/common/DBContainerInitializer.java | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java b/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java index 96d0ff8a2..ffa181f13 100644 --- a/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java +++ b/boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/GrafanaLGTMApplicationTest.java @@ -8,7 +8,7 @@ import io.restassured.RestAssured; import io.restassured.authentication.PreemptiveBasicAuthScheme; import io.restassured.http.ContentType; -import org.apache.hc.core5.http.HttpStatus; +import org.apache.http.HttpStatus; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; 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 d7b2dcd06..be24d54d4 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 @@ -13,8 +13,8 @@ import io.restassured.http.ContentType; import java.util.ArrayList; import java.util.List; -import org.apache.hc.core5.http.HttpHeaders; -import org.apache.hc.core5.http.HttpStatus; +import org.apache.http.HttpHeaders; +import org.apache.http.HttpStatus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/jpa/multitenancy/multitenancy-db/pom.xml b/jpa/multitenancy/multitenancy-db/pom.xml index 4cc4661f2..691a03d97 100644 --- a/jpa/multitenancy/multitenancy-db/pom.xml +++ b/jpa/multitenancy/multitenancy-db/pom.xml @@ -92,12 +92,6 @@ org.testcontainers junit-jupiter test - - - junit - junit - - org.testcontainers diff --git a/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/common/DBContainerInitializer.java b/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/common/DBContainerInitializer.java index 00eeaf5bc..70d99c7a0 100644 --- a/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/common/DBContainerInitializer.java +++ b/jpa/multitenancy/multitenancy-db/src/test/java/com/example/multitenancy/db/common/DBContainerInitializer.java @@ -12,7 +12,7 @@ public class DBContainerInitializer implements ApplicationContextInitializer { private static final PostgreSQLContainer POSTGRE_SQL_CONTAINER = - new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine")); + new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.4-alpine")); private static final MariaDBContainer MARIA_DB_CONTAINER = new MariaDBContainer<>(DockerImageName.parse("mariadb").withTag("11.4")); From 9d71560161513a99aa7d09fa5958eb335450190e Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Sat, 31 Aug 2024 07:36:24 +0000 Subject: [PATCH 3/5] fix : build issues --- .../example/ultimateredis/common/AbstractIntegrationTest.java | 2 +- open-api-spring-boot/pom.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/boot-ultimate-redis/src/test/java/com/example/ultimateredis/common/AbstractIntegrationTest.java b/boot-ultimate-redis/src/test/java/com/example/ultimateredis/common/AbstractIntegrationTest.java index 314d5a199..4829fa05d 100644 --- a/boot-ultimate-redis/src/test/java/com/example/ultimateredis/common/AbstractIntegrationTest.java +++ b/boot-ultimate-redis/src/test/java/com/example/ultimateredis/common/AbstractIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; -@ActiveProfiles({AppConstants.PROFILE_NOT_CLUSTER}) +@ActiveProfiles({AppConstants.PROFILE_STANDALONE}) @SpringBootTest( webEnvironment = RANDOM_PORT, classes = {TestcontainersConfiguration.class}) diff --git a/open-api-spring-boot/pom.xml b/open-api-spring-boot/pom.xml index 2833d04bc..bfb494ae2 100644 --- a/open-api-spring-boot/pom.xml +++ b/open-api-spring-boot/pom.xml @@ -81,12 +81,14 @@ jakarta.xml.bind jakarta.xml.bind-api + 2.3.3 org.glassfish.jaxb jaxb-runtime + 2.3.9 From fdac571241fe046a8d2ae64d46db21bbcde9e582 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Sat, 31 Aug 2024 07:39:16 +0000 Subject: [PATCH 4/5] removes deadcode --- .../multitenant/TenantRoutingDatasource.java | 22 ------------------- .../multitenant/TenantRoutingDatasource.java | 22 ------------------- 2 files changed, 44 deletions(-) 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 25bb466d6..191a915e6 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 @@ -37,26 +37,4 @@ 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/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 102e794d0..6038c43e3 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 @@ -31,26 +31,4 @@ 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; - } } From e08fbd4f89062e16f364b3861165442a63339071 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Sat, 31 Aug 2024 07:41:00 +0000 Subject: [PATCH 5/5] removes dead code --- .../config/routing/RoutingDataSource.java | 22 ------------------- 1 file changed, 22 deletions(-) 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 9e35188d0..577340c9b 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,26 +23,4 @@ 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; - } }