From bad04601be40b6a264f4cbac48b9d76391036270 Mon Sep 17 00:00:00 2001 From: geroza Date: Sun, 9 Dec 2018 10:03:48 -0200 Subject: [PATCH] * migrated the following modules: spring-boot spring-boot-autoconfiguration spring-boot-bootstrap spring-boot-client spring-boot-ctx-fluent spring-boot-disable-console-logging spring-boot-jasypt spring-boot-mvc spring-boot-ops spring-boot-vue spring-cloud/spring-cloud-vault spring-data-rest --- .../MySQLAutoconfiguration.java | 2 +- .../SpringBootBootstrapIntegrationTest.java | 13 ++----- .../DetailsServiceClientIntegrationTest.java | 7 ++-- .../disabling-console-jul/.gitignore | 1 + .../disabling-console-jul/pom.xml | 2 +- .../disabling-console-log4j2/.gitignore | 1 + .../disabling-console-log4j2/pom.xml | 2 +- .../disabling-console-logback/.gitignore | 1 + .../disabling-console-logback/pom.xml | 37 ++++++++++--------- .../java/com/baeldung/intro/AppLiveTest.java | 9 ++--- .../boot/DemoApplicationIntegrationTest.java | 5 +-- ...EmployeeRestControllerIntegrationTest.java | 5 ++- spring-cloud/spring-cloud-vault/pom.xml | 13 ++++++- 13 files changed, 54 insertions(+), 44 deletions(-) create mode 100644 spring-boot-disable-console-logging/disabling-console-jul/.gitignore create mode 100644 spring-boot-disable-console-logging/disabling-console-log4j2/.gitignore create mode 100644 spring-boot-disable-console-logging/disabling-console-logback/.gitignore diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java b/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java index d6fc1836c7..295e0d74c9 100644 --- a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java +++ b/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java @@ -47,7 +47,7 @@ public class MySQLAutoconfiguration { final DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); - dataSource.setUrl("jdbc:mysql://localhost:3306/myDb?createDatabaseIfNotExist=true"); + dataSource.setUrl("jdbc:mysql://localhost:3306/myDb?createDatabaseIfNotExist=true&&serverTimezone=UTC"); dataSource.setUsername("mysqluser"); dataSource.setPassword("mysqlpass"); diff --git a/spring-boot-bootstrap/src/test/java/org/baeldung/SpringBootBootstrapIntegrationTest.java b/spring-boot-bootstrap/src/test/java/org/baeldung/SpringBootBootstrapIntegrationTest.java index 8993617d5c..4d3c8a2266 100644 --- a/spring-boot-bootstrap/src/test/java/org/baeldung/SpringBootBootstrapIntegrationTest.java +++ b/spring-boot-bootstrap/src/test/java/org/baeldung/SpringBootBootstrapIntegrationTest.java @@ -4,25 +4,20 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import io.restassured.RestAssured; -import io.restassured.response.Response; import java.util.List; import org.baeldung.persistence.model.Book; import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) +import io.restassured.RestAssured; +import io.restassured.response.Response; + public class SpringBootBootstrapIntegrationTest { - private static final String API_ROOT = "http://localhost:8081/api/books"; + private static final String API_ROOT = "http://localhost:8080/api/books"; @Test public void whenGetAllBooks_thenOK() { diff --git a/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java b/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java index 71fb330663..d423300b85 100644 --- a/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java +++ b/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java @@ -10,7 +10,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.client.RestClientTest; -import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.client.MockRestServiceServer; @@ -18,8 +17,7 @@ import org.springframework.test.web.client.MockRestServiceServer; import com.fasterxml.jackson.databind.ObjectMapper; @RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -@RestClientTest(DetailsServiceClient.class) +@RestClientTest({ DetailsServiceClient.class, Application.class }) public class DetailsServiceClientIntegrationTest { @Autowired @@ -34,7 +32,8 @@ public class DetailsServiceClientIntegrationTest { @Before public void setUp() throws Exception { String detailsString = objectMapper.writeValueAsString(new Details("John Smith", "john")); - this.server.expect(requestTo("/john/details")).andRespond(withSuccess(detailsString, MediaType.APPLICATION_JSON)); + this.server.expect(requestTo("/john/details")) + .andRespond(withSuccess(detailsString, MediaType.APPLICATION_JSON)); } @Test diff --git a/spring-boot-disable-console-logging/disabling-console-jul/.gitignore b/spring-boot-disable-console-logging/disabling-console-jul/.gitignore new file mode 100644 index 0000000000..ff56635e49 --- /dev/null +++ b/spring-boot-disable-console-logging/disabling-console-jul/.gitignore @@ -0,0 +1 @@ +baeldung.log diff --git a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml index fbcd0768f9..9ccbd56231 100644 --- a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml @@ -8,7 +8,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 2.1.1.RELEASE diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/.gitignore b/spring-boot-disable-console-logging/disabling-console-log4j2/.gitignore new file mode 100644 index 0000000000..d3ae44ddfc --- /dev/null +++ b/spring-boot-disable-console-logging/disabling-console-log4j2/.gitignore @@ -0,0 +1 @@ +all.log diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml index 6f3f01669e..0b360bb366 100644 --- a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml @@ -8,7 +8,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 2.1.1.RELEASE diff --git a/spring-boot-disable-console-logging/disabling-console-logback/.gitignore b/spring-boot-disable-console-logging/disabling-console-logback/.gitignore new file mode 100644 index 0000000000..4e6aa917ed --- /dev/null +++ b/spring-boot-disable-console-logging/disabling-console-logback/.gitignore @@ -0,0 +1 @@ +disabled-console.log diff --git a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml index fef0a1f4c6..4b64885c66 100644 --- a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml @@ -1,19 +1,22 @@ - - 4.0.0 - disabling-console-logback - disabling-console-logback + + 4.0.0 + disabling-console-logback + disabling-console-logback + + + spring-boot-disable-console-logging + com.baeldung + 0.0.1-SNAPSHOT + ../ + + + + + org.springframework.boot + spring-boot-starter-web + + - - com.baeldung - spring-boot-disable-console-logging - 0.0.1-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-web - - - \ No newline at end of file diff --git a/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java b/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java index 44461c0cf6..2785054153 100644 --- a/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java +++ b/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java @@ -1,20 +1,19 @@ package com.baeldung.intro; +import static org.hamcrest.Matchers.equalTo; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + import org.junit.Test; import org.junit.runner.RunWith; 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.http.MediaType; -import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import static org.hamcrest.Matchers.equalTo; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) @AutoConfigureMockMvc diff --git a/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java b/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java index fba816c681..0541da3199 100644 --- a/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java +++ b/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java @@ -4,12 +4,11 @@ import org.baeldung.demo.DemoApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; @RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = DemoApplication.class) -@WebAppConfiguration +@SpringBootTest(classes = DemoApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) public class DemoApplicationIntegrationTest { @Test diff --git a/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java b/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java index d76dbfc803..a4b35889d6 100644 --- a/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java +++ b/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java @@ -22,13 +22,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; 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.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; @RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = DemoApplication.class) -@AutoConfigureMockMvc +@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = DemoApplication.class) +@AutoConfigureMockMvc // @TestPropertySource(locations = "classpath:application-integrationtest.properties") @AutoConfigureTestDatabase public class EmployeeRestControllerIntegrationTest { diff --git a/spring-cloud/spring-cloud-vault/pom.xml b/spring-cloud/spring-cloud-vault/pom.xml index 68b8e44875..3a7198ecc3 100644 --- a/spring-cloud/spring-cloud-vault/pom.xml +++ b/spring-cloud/spring-cloud-vault/pom.xml @@ -24,7 +24,7 @@ UTF-8 UTF-8 1.8 - Finchley.SR1 + Greenwich.M3 @@ -82,6 +82,17 @@ + + + + spring-milestones + Spring Milestones + http://repo.spring.io/milestone + + false + + +