diff --git a/spring-session-samples/spring-session-sample-boot-hazelcast/spring-session-sample-boot-hazelcast.gradle b/spring-session-samples/spring-session-sample-boot-hazelcast/spring-session-sample-boot-hazelcast.gradle index b8d2b97d..6993c505 100644 --- a/spring-session-samples/spring-session-sample-boot-hazelcast/spring-session-sample-boot-hazelcast.gradle +++ b/spring-session-samples/spring-session-sample-boot-hazelcast/spring-session-sample-boot-hazelcast.gradle @@ -1,19 +1,18 @@ apply plugin: 'io.spring.convention.spring-sample-boot' dependencies { - compile project(':spring-session-hazelcast') - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-thymeleaf" - compile "org.springframework.boot:spring-boot-starter-security" - compile "com.hazelcast:hazelcast-client" - compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect" - compile "org.webjars:bootstrap" - compile "org.webjars:html5shiv" - compile "org.webjars:webjars-locator-core" + compile project(':spring-session-hazelcast') + compile "org.springframework.boot:spring-boot-starter-web" + compile "org.springframework.boot:spring-boot-starter-thymeleaf" + compile "org.springframework.boot:spring-boot-starter-security" + compile "com.hazelcast:hazelcast" + compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect" + compile "org.webjars:bootstrap" + compile "org.webjars:html5shiv" + compile "org.webjars:webjars-locator-core" - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile "org.junit.jupiter:junit-jupiter-api" - testRuntime "org.junit.jupiter:junit-jupiter-engine" - integrationTestCompile seleniumDependencies - integrationTestCompile "org.testcontainers:testcontainers" + testCompile "org.springframework.boot:spring-boot-starter-test" + testCompile "org.junit.jupiter:junit-jupiter-api" + testRuntime "org.junit.jupiter:junit-jupiter-engine" + integrationTestCompile seleniumDependencies } diff --git a/spring-session-samples/spring-session-sample-boot-hazelcast/src/integration-test/java/sample/BootTests.java b/spring-session-samples/spring-session-sample-boot-hazelcast/src/integration-test/java/sample/BootTests.java index 2d5b8abd..bd4df824 100644 --- a/spring-session-samples/spring-session-sample-boot-hazelcast/src/integration-test/java/sample/BootTests.java +++ b/spring-session-samples/spring-session-sample-boot-hazelcast/src/integration-test/java/sample/BootTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,7 @@ package sample; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.openqa.selenium.WebDriver; -import org.testcontainers.containers.GenericContainer; import sample.pages.HomePage; import sample.pages.LoginPage; @@ -29,22 +27,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder; /** * @author Ellie Bahadori */ -@ExtendWith(SpringExtension.class) @AutoConfigureMockMvc @SpringBootTest(webEnvironment = WebEnvironment.MOCK) class BootTests { - private static final String DOCKER_IMAGE = "hazelcast/hazelcast:latest"; - @Autowired private MockMvc mockMvc; @@ -83,16 +75,4 @@ class BootTests { login.assertAt(); } - @TestConfiguration - static class Config { - - @Bean - GenericContainer hazelcastContainer() { - GenericContainer hazelcastContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(5701); - hazelcastContainer.start(); - return hazelcastContainer; - } - - } - } diff --git a/spring-session-samples/spring-session-sample-boot-hazelcast/src/main/java/sample/config/SessionConfig.java b/spring-session-samples/spring-session-sample-boot-hazelcast/src/main/java/sample/config/SessionConfig.java index d926b775..c54ad16c 100644 --- a/spring-session-samples/spring-session-sample-boot-hazelcast/src/main/java/sample/config/SessionConfig.java +++ b/spring-session-samples/spring-session-sample-boot-hazelcast/src/main/java/sample/config/SessionConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import org.springframework.session.hazelcast.PrincipalNameExtractor; public class SessionConfig { @Bean - public Config clientConfig() { + public Config hazelcastConfig() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.setPort(0); diff --git a/spring-session-samples/spring-session-sample-boot-hazelcast4/spring-session-sample-boot-hazelcast4.gradle b/spring-session-samples/spring-session-sample-boot-hazelcast4/spring-session-sample-boot-hazelcast4.gradle index 96c8ab27..2f7045dc 100644 --- a/spring-session-samples/spring-session-sample-boot-hazelcast4/spring-session-sample-boot-hazelcast4.gradle +++ b/spring-session-samples/spring-session-sample-boot-hazelcast4/spring-session-sample-boot-hazelcast4.gradle @@ -1,20 +1,19 @@ apply plugin: 'io.spring.convention.spring-sample-boot' dependencies { - compile project(':spring-session-hazelcast') - compile project(':hazelcast4') - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-thymeleaf" - compile "org.springframework.boot:spring-boot-starter-security" - compile "com.hazelcast:hazelcast:4.2.2" - compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect" - compile "org.webjars:bootstrap" - compile "org.webjars:html5shiv" - compile "org.webjars:webjars-locator-core" + compile project(':spring-session-hazelcast') + compile project(':hazelcast4') + compile "org.springframework.boot:spring-boot-starter-web" + compile "org.springframework.boot:spring-boot-starter-thymeleaf" + compile "org.springframework.boot:spring-boot-starter-security" + compile "com.hazelcast:hazelcast:4.2.2" + compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect" + compile "org.webjars:bootstrap" + compile "org.webjars:html5shiv" + compile "org.webjars:webjars-locator-core" - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile "org.junit.jupiter:junit-jupiter-api" - testRuntime "org.junit.jupiter:junit-jupiter-engine" - integrationTestCompile seleniumDependencies - integrationTestCompile "org.testcontainers:testcontainers" + testCompile "org.springframework.boot:spring-boot-starter-test" + testCompile "org.junit.jupiter:junit-jupiter-api" + testRuntime "org.junit.jupiter:junit-jupiter-engine" + integrationTestCompile seleniumDependencies } diff --git a/spring-session-samples/spring-session-sample-boot-hazelcast4/src/integration-test/java/sample/BootTests.java b/spring-session-samples/spring-session-sample-boot-hazelcast4/src/integration-test/java/sample/BootTests.java index 32212ce6..e947fa13 100644 --- a/spring-session-samples/spring-session-sample-boot-hazelcast4/src/integration-test/java/sample/BootTests.java +++ b/spring-session-samples/spring-session-sample-boot-hazelcast4/src/integration-test/java/sample/BootTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,7 @@ package sample; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.openqa.selenium.WebDriver; -import org.testcontainers.containers.GenericContainer; import sample.pages.HomePage; import sample.pages.LoginPage; @@ -29,19 +27,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder; -@ExtendWith(SpringExtension.class) @AutoConfigureMockMvc @SpringBootTest(webEnvironment = WebEnvironment.MOCK) class BootTests { - private static final String DOCKER_IMAGE = "hazelcast/hazelcast:latest"; - @Autowired private MockMvc mockMvc; @@ -80,16 +72,4 @@ class BootTests { login.assertAt(); } - @TestConfiguration - static class Config { - - @Bean - GenericContainer hazelcastContainer() { - GenericContainer hazelcastContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(5701); - hazelcastContainer.start(); - return hazelcastContainer; - } - - } - } diff --git a/spring-session-samples/spring-session-sample-boot-hazelcast4/src/main/java/sample/config/SessionConfig.java b/spring-session-samples/spring-session-sample-boot-hazelcast4/src/main/java/sample/config/SessionConfig.java index 06d95187..1e545e0a 100644 --- a/spring-session-samples/spring-session-sample-boot-hazelcast4/src/main/java/sample/config/SessionConfig.java +++ b/spring-session-samples/spring-session-sample-boot-hazelcast4/src/main/java/sample/config/SessionConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.springframework.session.hazelcast.HazelcastSessionSerializer; public class SessionConfig { @Bean - public Config clientConfig() { + public Config hazelcastConfig() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.setPort(0);