From b9789c23f0cacbc5fe1ec9ed90adb39893e1154e Mon Sep 17 00:00:00 2001 From: Haroon Khan Date: Mon, 22 Aug 2022 18:17:32 +0100 Subject: [PATCH] [JAVA-13976] Upgrade Spring Boot to 2.7.2 (#12603) * [JAVA-13976] Upgrade Spring Boot to 2.7.2 * [JAVA-13976] Fix failing test due to incorrect Jackson version --- .../graphql-error-handling/pom.xml | 6 +-- .../exception/GraphQLErrorAdapter.java | 4 +- mustache/pom.xml | 2 +- .../SpringMustacheApplication.java | 12 ++--- parent-boot-2/pom.xml | 4 +- persistence-modules/flyway/pom.xml | 5 +- .../spring-boot-persistence-mongodb-2/pom.xml | 5 -- .../src/main/resources/application.properties | 4 +- .../spring-data-mongodb-reactive/pom.xml | 2 - .../src/main/resources/application.yml | 2 + .../src/test/resources/application.yml | 3 +- pom.xml | 4 +- .../spring-boot-data-2/pom.xml | 2 +- .../scanner/AnnotationScannerApp.java | 16 ++++++ .../{ => jobrunr}/JobRunrSpringBootApp.java | 2 +- .../config/StorageProviderConfig.java | 2 +- .../main/java/com/baeldung/sprq/SpqrApp.java | 13 +++++ .../SampleAnnotationScannerUnitTest.java | 2 +- .../com/baeldung/jobrunr/JobRunrLiveTest.java | 3 -- .../GraphqlControllerIntegrationTest.java | 2 +- .../baeldung/spring/PersistenceConfig.java | 2 +- .../web/error/ErrorHandlingLiveTest.java | 3 +- spring-cloud-modules/pom.xml | 4 +- spring-cloud-modules/spring-cloud-bus/pom.xml | 4 +- .../spring-cloud-config/pom.xml | 4 +- .../kubernetes-guide/client-service/pom.xml | 7 ++- .../cloud/kubernetes/client/Application.java | 11 +--- .../src/main/resources/application.yaml | 11 +++- .../spring-cloud-kubernetes/pom.xml | 2 +- .../spring-cloud-openfeign/pom.xml | 4 +- .../spring-cloud-ribbon-client/pom.xml | 4 +- .../spring-cloud-security/pom.xml | 4 +- .../spring-cloud-zuul/pom.xml | 4 +- spring-jenkins-pipeline/pom.xml | 4 +- .../src/main/resources/application.properties | 2 + .../src/main/resources/acl-schema.sql | 50 +++++++++---------- .../src/main/resources/application.properties | 4 +- .../src/main/resources/data.sql | 2 +- .../spring-security-web-boot-3/pom.xml | 1 - .../baeldung/spring/PersistenceConfig.java | 2 +- .../src/main/resources/data.sql | 8 +-- .../spring-session-mongodb/pom.xml | 7 +-- .../commonutil/ScenarioContextUI.java | 3 +- 43 files changed, 127 insertions(+), 115 deletions(-) create mode 100644 spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java rename spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/{ => jobrunr}/JobRunrSpringBootApp.java (96%) rename spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/{ => jobrunr}/config/StorageProviderConfig.java (93%) create mode 100644 spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java diff --git a/graphql-modules/graphql-error-handling/pom.xml b/graphql-modules/graphql-error-handling/pom.xml index f10bb524fb..d89ff1509d 100644 --- a/graphql-modules/graphql-error-handling/pom.xml +++ b/graphql-modules/graphql-error-handling/pom.xml @@ -36,12 +36,10 @@ org.projectlombok lombok - ${lombok.version} com.h2database h2 - ${h2.version} org.springframework.boot @@ -51,13 +49,12 @@ com.graphql-java graphql-spring-boot-starter-test - test ${graphql-spring-boot-starter.version} + test org.skyscreamer jsonassert - ${jsonassert.version} test @@ -65,7 +62,6 @@ 5.0.2 5.2.4 - 1.5.0 \ No newline at end of file diff --git a/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java b/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java index d982f98db3..94f696a940 100644 --- a/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java +++ b/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java @@ -1,6 +1,6 @@ package com.baeldung.graphql.error.handling.exception; -import graphql.ErrorType; +import graphql.ErrorClassification; import graphql.ExceptionWhileDataFetching; import graphql.GraphQLError; import graphql.language.SourceLocation; @@ -27,7 +27,7 @@ public class GraphQLErrorAdapter implements GraphQLError { } @Override - public ErrorType getErrorType() { + public ErrorClassification getErrorType() { return error.getErrorType(); } diff --git a/mustache/pom.xml b/mustache/pom.xml index faa8bfd8a1..b5d39ef15e 100644 --- a/mustache/pom.xml +++ b/mustache/pom.xml @@ -55,7 +55,7 @@ - 0.9.2 + 0.9.10 0.8 3.3.7 diff --git a/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java b/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java index 8cdf89d08a..d6b3528dcb 100644 --- a/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java +++ b/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java @@ -1,12 +1,11 @@ package com.baeldung.springmustache; +import com.samskivert.mustache.DefaultCollector; import com.samskivert.mustache.Mustache; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.mustache.MustacheEnvironmentCollector; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; -import org.springframework.core.env.Environment; @SpringBootApplication @ComponentScan(basePackages = {"com.baeldung"}) @@ -17,16 +16,11 @@ public class SpringMustacheApplication { } @Bean - public Mustache.Compiler mustacheCompiler(Mustache.TemplateLoader templateLoader, Environment environment) { - - MustacheEnvironmentCollector collector = new MustacheEnvironmentCollector(); - collector.setEnvironment(environment); - + public Mustache.Compiler mustacheCompiler(Mustache.TemplateLoader templateLoader) { return Mustache.compiler() .defaultValue("Some Default Value") .withLoader(templateLoader) - .withCollector(collector); - + .withCollector(new DefaultCollector()); } } diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 85f1805a00..1d6c593293 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -88,8 +88,8 @@ 3.3.0 1.0.22.RELEASE - 2.6.4 + 2.7.2 1.9.1 - \ No newline at end of file + diff --git a/persistence-modules/flyway/pom.xml b/persistence-modules/flyway/pom.xml index a339a266e3..67dd0644bd 100644 --- a/persistence-modules/flyway/pom.xml +++ b/persistence-modules/flyway/pom.xml @@ -19,7 +19,6 @@ org.flywaydb flyway-core - ${flyway-core.version} org.springframework.boot @@ -64,8 +63,8 @@ - 8.0.0 - 8.0.0 + 8.5.13 + 2.1.214 \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml b/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml index a745d4efc4..cd7198b931 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml +++ b/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml @@ -27,13 +27,8 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test - - 3.2.6 - - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties index cb1eab9443..30cc5abbcc 100644 --- a/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties @@ -1,3 +1,5 @@ spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1 spring.datasource.username=sa -spring.datasource.password=sa \ No newline at end of file +spring.datasource.password=sa + +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-data-mongodb-reactive/pom.xml b/persistence-modules/spring-data-mongodb-reactive/pom.xml index ac2bf14635..85c9a4c4b6 100644 --- a/persistence-modules/spring-data-mongodb-reactive/pom.xml +++ b/persistence-modules/spring-data-mongodb-reactive/pom.xml @@ -57,7 +57,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test @@ -127,7 +126,6 @@ 5.3.15 4.5.2 3.3.1.RELEASE - 3.2.6 \ No newline at end of file diff --git a/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml b/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml index f25c6ea0e3..326bdff8a2 100644 --- a/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml +++ b/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml @@ -9,3 +9,5 @@ spring: jpa: hibernate: ddl-auto: create + properties: + globally_quoted_identifiers: true diff --git a/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml b/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml index 33b7231838..57038dc362 100644 --- a/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml +++ b/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml @@ -8,4 +8,5 @@ spring: ddl-auto: create-drop properties: hibernate: - dialect: org.hibernate.dialect.H2Dialect \ No newline at end of file + dialect: org.hibernate.dialect.H2Dialect + globally_quoted_identifiers: true \ No newline at end of file diff --git a/pom.xml b/pom.xml index f142d7bd96..5cf2a2907d 100644 --- a/pom.xml +++ b/pom.xml @@ -583,7 +583,7 @@ spring-jenkins-pipeline spring-jersey - spring-jinq + spring-jms spring-kafka @@ -977,7 +977,7 @@ spring-jenkins-pipeline spring-jersey - spring-jinq + spring-jms spring-kafka diff --git a/spring-boot-modules/spring-boot-data-2/pom.xml b/spring-boot-modules/spring-boot-data-2/pom.xml index cd03d1b9b1..9aaab02925 100644 --- a/spring-boot-modules/spring-boot-data-2/pom.xml +++ b/spring-boot-modules/spring-boot-data-2/pom.xml @@ -41,7 +41,7 @@ - 6.5.3 + 6.6.5 \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java new file mode 100644 index 0000000000..b215090447 --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java @@ -0,0 +1,16 @@ +package com.baeldung.annotation.scanner; + +import org.jobrunr.autoconfigure.JobRunrAutoConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@EnableAutoConfiguration(exclude = { JobRunrAutoConfiguration.class}) +public class AnnotationScannerApp { + + public static void main(String[] args) { + SpringApplication.run(AnnotationScannerApp.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/JobRunrSpringBootApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/JobRunrSpringBootApp.java similarity index 96% rename from spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/JobRunrSpringBootApp.java rename to spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/JobRunrSpringBootApp.java index 3821332132..932ceb249a 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/JobRunrSpringBootApp.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/JobRunrSpringBootApp.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.jobrunr; import com.baeldung.jobrunr.service.SampleJobService; import org.jobrunr.scheduling.JobScheduler; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/config/StorageProviderConfig.java similarity index 93% rename from spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java rename to spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/config/StorageProviderConfig.java index e4b8cf12d7..631ba1834c 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/config/StorageProviderConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.config; +package com.baeldung.jobrunr.config; import org.jobrunr.jobs.mappers.JobMapper; import org.jobrunr.storage.InMemoryStorageProvider; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java new file mode 100644 index 0000000000..4a205dcc1f --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java @@ -0,0 +1,13 @@ +package com.baeldung.sprq; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpqrApp { + + public static void main(String[] args) { + SpringApplication.run(SpqrApp.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java index 7c3d01b5e8..c69821d0c0 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java @@ -13,7 +13,7 @@ import org.springframework.test.context.junit4.SpringRunner; import static org.junit.Assert.*; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = AnnotationScannerApp.class) public class SampleAnnotationScannerUnitTest { @Autowired private List scannerList; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java index 2c259b6879..b00d1c472f 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java @@ -1,6 +1,5 @@ package com.baeldung.jobrunr; -import org.awaitility.Awaitility; import org.jobrunr.jobs.states.StateName; import org.jobrunr.storage.StorageProvider; import org.junit.Test; @@ -10,8 +9,6 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.JobRunrSpringBootApp; - import java.net.URI; import java.util.concurrent.TimeUnit; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java index b1054f09f8..ec28b98ac7 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java @@ -16,7 +16,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = SpqrApp.class) @AutoConfigureMockMvc public class GraphqlControllerIntegrationTest { diff --git a/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java b/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java index 8887510eca..78c826d6cd 100644 --- a/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ b/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -77,7 +77,7 @@ public class PersistenceConfig { final Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); return hibernateProperties; } diff --git a/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java b/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java index 3e21af524f..9ef8942634 100644 --- a/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java +++ b/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java @@ -59,8 +59,7 @@ public class ErrorHandlingLiveTest { webClient.getOptions() .setThrowExceptionOnFailingStatusCode(false); HtmlPage page = webClient.getPage(EXCEPTION_ENDPOINT); - assertThat(page.getBody() - .asText()).contains("Whitelabel Error Page"); + assertThat(page.getBody().asNormalizedText()).contains("Whitelabel Error Page"); } } } diff --git a/spring-cloud-modules/pom.xml b/spring-cloud-modules/pom.xml index 6d44cb015b..43ccfd5501 100644 --- a/spring-cloud-modules/pom.xml +++ b/spring-cloud-modules/pom.xml @@ -85,7 +85,7 @@ - 2021.0.0 + 2021.0.3 2.2.3.RELEASE 2.2.3.RELEASE 1.4.7.RELEASE @@ -94,4 +94,4 @@ 3.1.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-bus/pom.xml b/spring-cloud-modules/spring-cloud-bus/pom.xml index 4caba15ca9..4be1a60062 100644 --- a/spring-cloud-modules/spring-cloud-bus/pom.xml +++ b/spring-cloud-modules/spring-cloud-bus/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-config/pom.xml b/spring-cloud-modules/spring-cloud-config/pom.xml index 09be8ae1b8..fc9a989844 100644 --- a/spring-cloud-modules/spring-cloud-config/pom.xml +++ b/spring-cloud-modules/spring-cloud-config/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml index 8af035e1db..4da6ac408b 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml +++ b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml @@ -32,6 +32,7 @@ org.springframework.cloud spring-cloud-starter-kubernetes-config + ${spring.cloud.k8s.config.version} org.springframework.boot @@ -54,6 +55,7 @@ org.springframework.cloud spring-cloud-starter-kubernetes-ribbon + ${spring.cloud.k8s.config.version} org.springframework.cloud @@ -83,7 +85,8 @@ - 1.1.8.RELEASE + 2.1.3 + 1.1.10.RELEASE - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java index 24e562c79b..b31e6232ac 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java +++ b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java @@ -3,11 +3,8 @@ package com.baeldung.spring.cloud.kubernetes.client; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; -import org.springframework.cloud.client.loadbalancer.LoadBalanced; -import org.springframework.cloud.netflix.ribbon.RibbonClient; -import org.springframework.context.annotation.Bean; -import org.springframework.web.client.RestTemplate; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.netflix.ribbon.RibbonClient; @SpringBootApplication @EnableDiscoveryClient @@ -15,12 +12,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @RibbonClient(name = "travel-agency-service", configuration = RibbonConfiguration.class) public class Application { - @LoadBalanced - @Bean - RestTemplate restTemplate() { - return new RestTemplate(); - } - public static void main(String[] args) { SpringApplication.run(Application.class, args); } diff --git a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml index f966fdd7a5..aad4568e87 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml +++ b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml @@ -1,6 +1,15 @@ spring: application.name: client-service - cloud.kubernetes.reload.enabled: true + cloud: + kubernetes: + reload: + enabled: true + discovery: + enabled: true + all-namespaces: false + primary-port-name: "default-http" + discovery-server-url: "http://myapp-discoveryserver" + include-not-ready-addresses: true server.port: 8080 management: endpoint: diff --git a/spring-cloud-modules/spring-cloud-kubernetes/pom.xml b/spring-cloud-modules/spring-cloud-kubernetes/pom.xml index be555d01e9..cffdabd92b 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud-modules/spring-cloud-kubernetes/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 \ No newline at end of file diff --git a/spring-cloud-modules/spring-cloud-openfeign/pom.xml b/spring-cloud-modules/spring-cloud-openfeign/pom.xml index 5657577cb0..a6a24c376e 100644 --- a/spring-cloud-modules/spring-cloud-openfeign/pom.xml +++ b/spring-cloud-modules/spring-cloud-openfeign/pom.xml @@ -64,7 +64,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml b/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml index b78f6ef5cf..5c8fc733dd 100644 --- a/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml @@ -46,7 +46,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-security/pom.xml b/spring-cloud-modules/spring-cloud-security/pom.xml index 43eb6e61e8..15b5a9c4bc 100644 --- a/spring-cloud-modules/spring-cloud-security/pom.xml +++ b/spring-cloud-modules/spring-cloud-security/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-zuul/pom.xml b/spring-cloud-modules/spring-cloud-zuul/pom.xml index b04a21da1c..6929de0539 100644 --- a/spring-cloud-modules/spring-cloud-zuul/pom.xml +++ b/spring-cloud-modules/spring-cloud-zuul/pom.xml @@ -80,8 +80,8 @@ - 2021.0.0 + 2021.0.3 2.2.7.RELEASE - \ No newline at end of file + diff --git a/spring-jenkins-pipeline/pom.xml b/spring-jenkins-pipeline/pom.xml index 7cd529020a..62e8283c5a 100644 --- a/spring-jenkins-pipeline/pom.xml +++ b/spring-jenkins-pipeline/pom.xml @@ -37,7 +37,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test @@ -82,7 +81,6 @@ 2.17 - 3.2.6 - \ No newline at end of file + diff --git a/spring-katharsis/src/main/resources/application.properties b/spring-katharsis/src/main/resources/application.properties index 415ec1723b..5325d47223 100644 --- a/spring-katharsis/src/main/resources/application.properties +++ b/spring-katharsis/src/main/resources/application.properties @@ -5,6 +5,8 @@ spring.jpa.show-sql = false spring.jpa.hibernate.ddl-auto = create-drop spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.H2Dialect +spring.jpa.properties.hibernate.globally_quoted_identifiers=true + server.port=8082 server.servlet.context-path=/spring-katharsis diff --git a/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql b/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql index 9f74048230..3937efa544 100644 --- a/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql +++ b/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql @@ -1,50 +1,50 @@ create table IF NOT EXISTS system_message (id integer not null, content varchar(255), primary key (id)); CREATE TABLE IF NOT EXISTS acl_sid ( - id bigint(20) NOT NULL AUTO_INCREMENT, - principal tinyint(1) NOT NULL, + id bigint NOT NULL AUTO_INCREMENT, + principal tinyint NOT NULL, sid varchar(100) NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_1 (sid,principal) + CONSTRAINT unique_uk_1 UNIQUE (sid,principal) ); CREATE TABLE IF NOT EXISTS acl_class ( - id bigint(20) NOT NULL AUTO_INCREMENT, + id bigint NOT NULL AUTO_INCREMENT, class varchar(255) NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_2 (class) + CONSTRAINT unique_uk_2 UNIQUE (class) ); - + CREATE TABLE IF NOT EXISTS acl_entry ( - id bigint(20) NOT NULL AUTO_INCREMENT, - acl_object_identity bigint(20) NOT NULL, - ace_order int(11) NOT NULL, - sid bigint(20) NOT NULL, - mask int(11) NOT NULL, - granting tinyint(1) NOT NULL, - audit_success tinyint(1) NOT NULL, - audit_failure tinyint(1) NOT NULL, + id bigint NOT NULL AUTO_INCREMENT, + acl_object_identity bigint NOT NULL, + ace_order int NOT NULL, + sid bigint NOT NULL, + mask int NOT NULL, + granting tinyint NOT NULL, + audit_success tinyint NOT NULL, + audit_failure tinyint NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_4 (acl_object_identity,ace_order) + CONSTRAINT unique_uk_4 UNIQUE (acl_object_identity,ace_order) ); - + CREATE TABLE IF NOT EXISTS acl_object_identity ( - id bigint(20) NOT NULL AUTO_INCREMENT, - object_id_class bigint(20) NOT NULL, - object_id_identity bigint(20) NOT NULL, - parent_object bigint(20) DEFAULT NULL, - owner_sid bigint(20) DEFAULT NULL, - entries_inheriting tinyint(1) NOT NULL, + id bigint NOT NULL AUTO_INCREMENT, + object_id_class bigint NOT NULL, + object_id_identity bigint NOT NULL, + parent_object bigint DEFAULT NULL, + owner_sid bigint DEFAULT NULL, + entries_inheriting tinyint NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_3 (object_id_class,object_id_identity) + CONSTRAINT unique_uk_3 UNIQUE (object_id_class,object_id_identity) ); - + ALTER TABLE acl_entry ADD FOREIGN KEY (acl_object_identity) REFERENCES acl_object_identity(id); ALTER TABLE acl_entry ADD FOREIGN KEY (sid) REFERENCES acl_sid(id); - + -- -- Constraints for table acl_object_identity -- diff --git a/spring-security-modules/spring-security-social-login/src/main/resources/application.properties b/spring-security-modules/spring-security-social-login/src/main/resources/application.properties index 57348051ac..02b0cd94c4 100644 --- a/spring-security-modules/spring-security-social-login/src/main/resources/application.properties +++ b/spring-security-modules/spring-security-social-login/src/main/resources/application.properties @@ -3,4 +3,6 @@ spring.social.facebook.appSecret=abefd6497e9cc01ad03be28509617bf0 spring.thymeleaf.cache=false server.servlet.register-default-servlet=true spring.sql.init.mode=always -spring.jpa.defer-datasource-initialization=true \ No newline at end of file +spring.jpa.defer-datasource-initialization=true + +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/spring-security-modules/spring-security-social-login/src/main/resources/data.sql b/spring-security-modules/spring-security-social-login/src/main/resources/data.sql index 3b26afef32..b13a1f143e 100644 --- a/spring-security-modules/spring-security-social-login/src/main/resources/data.sql +++ b/spring-security-modules/spring-security-social-login/src/main/resources/data.sql @@ -1 +1 @@ -insert into User (id, username, password) values (1,'john', '123'); \ No newline at end of file +insert into "user" ("id", "username", "password") values (1,'john', '123'); \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-boot-3/pom.xml b/spring-security-modules/spring-security-web-boot-3/pom.xml index 0984c25e07..5229068dfa 100644 --- a/spring-security-modules/spring-security-web-boot-3/pom.xml +++ b/spring-security-modules/spring-security-web-boot-3/pom.xml @@ -32,7 +32,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - 3.3.1 commons-io diff --git a/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java b/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java index 4a4b9eee3f..910afedbac 100644 --- a/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ b/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -78,7 +78,7 @@ public class PersistenceConfig { final Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); return hibernateProperties; } diff --git a/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql b/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql index 5fba12dd85..50fc79a5c9 100644 --- a/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql +++ b/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql @@ -1,5 +1,5 @@ -insert into User (id, firstName, lastName, email, age) values (1, 'john', 'doe', 'john@doe.com', 22); -insert into User (id, firstName, lastName, email, age) values (2, 'tom', 'doe', 'tom@doe.com', 26); +insert into "User" ("id", "firstName", "lastName", "email", "age") values (1, 'john', 'doe', 'john@doe.com', 22); +insert into "User" ("id", "firstName", "lastName", "email", "age") values (2, 'tom', 'doe', 'tom@doe.com', 26); -insert into MyUser (id, firstName, lastName, email, age) values (1, 'john', 'doe', 'john@doe.com', 22); -insert into MyUser (id, firstName, lastName, email, age) values (2, 'tom', 'doe', 'tom@doe.com', 26); +insert into "MyUser" ("id", "firstName", "lastName", "email", "age") values (1, 'john', 'doe', 'john@doe.com', 22); +insert into "MyUser" ("id", "firstName", "lastName", "email", "age") values (2, 'tom', 'doe', 'tom@doe.com', 26); diff --git a/spring-web-modules/spring-session/spring-session-mongodb/pom.xml b/spring-web-modules/spring-session/spring-session-mongodb/pom.xml index e34589c75b..6e5c12d487 100644 --- a/spring-web-modules/spring-session/spring-session-mongodb/pom.xml +++ b/spring-web-modules/spring-session/spring-session-mongodb/pom.xml @@ -37,7 +37,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test @@ -51,8 +50,4 @@ - - 3.2.6 - - - \ No newline at end of file + diff --git a/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java b/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java index 66aabece11..d775c8a152 100644 --- a/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java +++ b/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java @@ -1,5 +1,6 @@ package com.baeldung.cucumber.tags.acceptance.commonutil; +import org.openqa.selenium.Platform; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.remote.DesiredCapabilities; @@ -34,7 +35,7 @@ public class ScenarioContextUI { } private static WebDriver getRemoteWebDriver(URL url) { - return new RemoteWebDriver(url, DesiredCapabilities.chrome()); + return new RemoteWebDriver(url, new DesiredCapabilities("chrome", "", Platform.ANY)); } private static WebDriver getLocalChromeDriver() {