Skip to content

Commit bad0460

Browse files
committed
* 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
1 parent a2ceb57 commit bad0460

File tree

13 files changed

+54
-44
lines changed

13 files changed

+54
-44
lines changed

spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public DataSource dataSource() {
4747
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
4848

4949
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
50-
dataSource.setUrl("jdbc:mysql://localhost:3306/myDb?createDatabaseIfNotExist=true");
50+
dataSource.setUrl("jdbc:mysql://localhost:3306/myDb?createDatabaseIfNotExist=true&&serverTimezone=UTC");
5151
dataSource.setUsername("mysqluser");
5252
dataSource.setPassword("mysqlpass");
5353

spring-boot-bootstrap/src/test/java/org/baeldung/SpringBootBootstrapIntegrationTest.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,20 @@
44
import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
55
import static org.junit.Assert.assertEquals;
66
import static org.junit.Assert.assertTrue;
7-
import io.restassured.RestAssured;
8-
import io.restassured.response.Response;
97

108
import java.util.List;
119

1210
import org.baeldung.persistence.model.Book;
1311
import org.junit.Test;
14-
import org.junit.runner.RunWith;
15-
import org.springframework.boot.test.context.SpringBootTest;
16-
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
1712
import org.springframework.http.HttpStatus;
1813
import org.springframework.http.MediaType;
19-
import org.springframework.test.context.junit4.SpringRunner;
2014

21-
@RunWith(SpringRunner.class)
22-
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT)
15+
import io.restassured.RestAssured;
16+
import io.restassured.response.Response;
17+
2318
public class SpringBootBootstrapIntegrationTest {
2419

25-
private static final String API_ROOT = "http://localhost:8081/api/books";
20+
private static final String API_ROOT = "http://localhost:8080/api/books";
2621

2722
@Test
2823
public void whenGetAllBooks_thenOK() {

spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@
1010
import org.junit.runner.RunWith;
1111
import org.springframework.beans.factory.annotation.Autowired;
1212
import org.springframework.boot.test.autoconfigure.web.client.RestClientTest;
13-
import org.springframework.boot.test.context.SpringBootTest;
1413
import org.springframework.http.MediaType;
1514
import org.springframework.test.context.junit4.SpringRunner;
1615
import org.springframework.test.web.client.MockRestServiceServer;
1716

1817
import com.fasterxml.jackson.databind.ObjectMapper;
1918

2019
@RunWith(SpringRunner.class)
21-
@SpringBootTest(classes = Application.class)
22-
@RestClientTest(DetailsServiceClient.class)
20+
@RestClientTest({ DetailsServiceClient.class, Application.class })
2321
public class DetailsServiceClientIntegrationTest {
2422

2523
@Autowired
@@ -34,7 +32,8 @@ public class DetailsServiceClientIntegrationTest {
3432
@Before
3533
public void setUp() throws Exception {
3634
String detailsString = objectMapper.writeValueAsString(new Details("John Smith", "john"));
37-
this.server.expect(requestTo("/john/details")).andRespond(withSuccess(detailsString, MediaType.APPLICATION_JSON));
35+
this.server.expect(requestTo("/john/details"))
36+
.andRespond(withSuccess(detailsString, MediaType.APPLICATION_JSON));
3837
}
3938

4039
@Test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
baeldung.log

spring-boot-disable-console-logging/disabling-console-jul/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.springframework.boot</groupId>
1010
<artifactId>spring-boot-starter-parent</artifactId>
11-
<version>2.0.5.RELEASE</version>
11+
<version>2.1.1.RELEASE</version>
1212
</parent>
1313

1414
<dependencies>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
all.log

spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.springframework.boot</groupId>
1010
<artifactId>spring-boot-starter-parent</artifactId>
11-
<version>2.0.5.RELEASE</version>
11+
<version>2.1.1.RELEASE</version>
1212
</parent>
1313

1414
<dependencies>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
disabled-console.log
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<modelVersion>4.0.0</modelVersion>
3-
<artifactId>disabling-console-logback</artifactId>
4-
<name>disabling-console-logback</name>
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>disabling-console-logback</artifactId>
6+
<name>disabling-console-logback</name>
7+
8+
<parent>
9+
<artifactId>spring-boot-disable-console-logging</artifactId>
10+
<groupId>com.baeldung</groupId>
11+
<version>0.0.1-SNAPSHOT</version>
12+
<relativePath>../</relativePath>
13+
</parent>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.springframework.boot</groupId>
18+
<artifactId>spring-boot-starter-web</artifactId>
19+
</dependency>
20+
</dependencies>
521

6-
<parent>
7-
<groupId>com.baeldung</groupId>
8-
<artifactId>spring-boot-disable-console-logging</artifactId>
9-
<version>0.0.1-SNAPSHOT</version>
10-
</parent>
11-
12-
<dependencies>
13-
<dependency>
14-
<groupId>org.springframework.boot</groupId>
15-
<artifactId>spring-boot-starter-web</artifactId>
16-
</dependency>
17-
</dependencies>
18-
1922
</project>

spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package com.baeldung.intro;
22

3+
import static org.hamcrest.Matchers.equalTo;
4+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
5+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
6+
37
import org.junit.Test;
48
import org.junit.runner.RunWith;
59
import org.springframework.beans.factory.annotation.Autowired;
610
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
711
import org.springframework.boot.test.context.SpringBootTest;
812
import org.springframework.http.MediaType;
9-
import org.springframework.test.context.TestPropertySource;
1013
import org.springframework.test.context.junit4.SpringRunner;
1114
import org.springframework.test.web.servlet.MockMvc;
1215
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
1316

14-
import static org.hamcrest.Matchers.equalTo;
15-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
16-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
17-
1817
@RunWith(SpringRunner.class)
1918
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
2019
@AutoConfigureMockMvc

spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
import org.junit.Test;
55
import org.junit.runner.RunWith;
66
import org.springframework.boot.test.context.SpringBootTest;
7+
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
78
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
8-
import org.springframework.test.context.web.WebAppConfiguration;
99

1010
@RunWith(SpringJUnit4ClassRunner.class)
11-
@SpringBootTest(classes = DemoApplication.class)
12-
@WebAppConfiguration
11+
@SpringBootTest(classes = DemoApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
1312
public class DemoApplicationIntegrationTest {
1413

1514
@Test

spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
2323
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
2424
import org.springframework.boot.test.context.SpringBootTest;
25+
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
2526
import org.springframework.http.MediaType;
2627
import org.springframework.test.context.junit4.SpringRunner;
2728
import org.springframework.test.web.servlet.MockMvc;
2829

2930
@RunWith(SpringRunner.class)
30-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = DemoApplication.class)
31-
@AutoConfigureMockMvc
31+
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = DemoApplication.class)
32+
@AutoConfigureMockMvc
3233
// @TestPropertySource(locations = "classpath:application-integrationtest.properties")
3334
@AutoConfigureTestDatabase
3435
public class EmployeeRestControllerIntegrationTest {

spring-cloud/spring-cloud-vault/pom.xml

+12-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2525
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2626
<java.version>1.8</java.version>
27-
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
27+
<spring-cloud.version>Greenwich.M3</spring-cloud.version>
2828
</properties>
2929

3030
<dependencies>
@@ -82,6 +82,17 @@
8282
</plugin>
8383
</plugins>
8484
</build>
85+
86+
<repositories>
87+
<repository>
88+
<id>spring-milestones</id>
89+
<name>Spring Milestones</name>
90+
<url>http://repo.spring.io/milestone</url>
91+
<snapshots>
92+
<enabled>false</enabled>
93+
</snapshots>
94+
</repository>
95+
</repositories>
8596

8697

8798
</project>

0 commit comments

Comments
 (0)