Merge pull request #5874 from rozagerardo/geroza/BAEL-10844_subtask-part-1_BAEL-10354_migrateparent-boot-to-spring-boot-2.1_part-2

[BAEL-10844] | Upgrade set of modules to use boot 2.1 - part 2
This commit is contained in:
Loredana Crusoveanu 2018-12-09 20:13:30 +02:00 committed by GitHub
commit bae846571a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 106 additions and 75 deletions

View File

@ -9,10 +9,10 @@
<description>This is simple boot application demonstrating a custom auto-configuration</description> <description>This is simple boot application demonstrating a custom auto-configuration</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -47,7 +47,7 @@ public class MySQLAutoconfiguration {
final DriverManagerDataSource dataSource = new DriverManagerDataSource(); final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); 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.setUsername("mysqluser");
dataSource.setPassword("mysqlpass"); dataSource.setPassword("mysqlpass");

View File

@ -8,10 +8,10 @@
<name>spring-boot-bootstrap</name> <name>spring-boot-bootstrap</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -4,25 +4,20 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import java.util.List; import java.util.List;
import org.baeldung.persistence.model.Book; import org.baeldung.persistence.model.Book;
import org.junit.Test; 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.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class) import io.restassured.RestAssured;
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) import io.restassured.response.Response;
public class SpringBootBootstrapIntegrationTest { 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 @Test
public void whenGetAllBooks_thenOK() { public void whenGetAllBooks_thenOK() {

View File

@ -9,10 +9,10 @@
<description>This is simple boot client application for Spring boot actuator test</description> <description>This is simple boot client application for Spring boot actuator test</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -10,7 +10,6 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.client.RestClientTest; import org.springframework.boot.test.autoconfigure.web.client.RestClientTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.test.web.client.MockRestServiceServer;
@ -18,8 +17,7 @@ import org.springframework.test.web.client.MockRestServiceServer;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class) @RestClientTest({ DetailsServiceClient.class, Application.class })
@RestClientTest(DetailsServiceClient.class)
public class DetailsServiceClientIntegrationTest { public class DetailsServiceClientIntegrationTest {
@Autowired @Autowired
@ -34,7 +32,8 @@ public class DetailsServiceClientIntegrationTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
String detailsString = objectMapper.writeValueAsString(new Details("John Smith", "john")); 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 @Test

View File

@ -8,10 +8,10 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -0,0 +1 @@
baeldung.log

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version> <version>2.1.1.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -0,0 +1 @@
all.log

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version> <version>2.1.1.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -0,0 +1 @@
disabled-console.log

View File

@ -1,12 +1,15 @@
<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"> <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">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>disabling-console-logback</artifactId> <artifactId>disabling-console-logback</artifactId>
<name>disabling-console-logback</name> <name>disabling-console-logback</name>
<parent> <parent>
<groupId>com.baeldung</groupId>
<artifactId>spring-boot-disable-console-logging</artifactId> <artifactId>spring-boot-disable-console-logging</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -7,10 +7,10 @@
<description>Projects for Disabling Spring Boot Console Logging tutorials</description> <description>Projects for Disabling Spring Boot Console Logging tutorials</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<modules> <modules>

View File

@ -10,10 +10,10 @@
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -8,10 +8,10 @@
<description>Module For Spring Boot MVC</description> <description>Module For Spring Boot MVC</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -9,10 +9,10 @@
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -12,10 +12,10 @@
<description>Demo project for Spring Boot Vue project</description> <description>Demo project for Spring Boot Vue project</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<properties> <properties>

View File

@ -8,10 +8,10 @@
<description>This is simple boot application for Spring boot actuator test</description> <description>This is simple boot application for Spring boot actuator test</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -1,20 +1,19 @@
package com.baeldung.intro; 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.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; 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) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@AutoConfigureMockMvc @AutoConfigureMockMvc

View File

@ -4,12 +4,11 @@ import org.baeldung.demo.DemoApplication;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; 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.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = DemoApplication.class) @SpringBootTest(classes = DemoApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
@WebAppConfiguration
public class DemoApplicationIntegrationTest { public class DemoApplicationIntegrationTest {
@Test @Test

View File

@ -22,12 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = DemoApplication.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = DemoApplication.class)
@AutoConfigureMockMvc @AutoConfigureMockMvc
// @TestPropertySource(locations = "classpath:application-integrationtest.properties") // @TestPropertySource(locations = "classpath:application-integrationtest.properties")
@AutoConfigureTestDatabase @AutoConfigureTestDatabase

View File

@ -11,17 +11,17 @@
<description>Example ETL Load Project</description> <description>Example ETL Load Project</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../../../parent-boot-2.0-temp</relativePath> <relativePath>../../../parent-boot-2</relativePath>
</parent> </parent>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version> <spring-cloud.version>Greenwich.M3</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
@ -70,5 +70,16 @@
</plugins> </plugins>
</build> </build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project> </project>

View File

@ -12,17 +12,17 @@
<description>Example transform ETL step</description> <description>Example transform ETL step</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../../../parent-boot-2.0-temp</relativePath> <relativePath>../../../parent-boot-2</relativePath>
</parent> </parent>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version> <spring-cloud.version>Greenwich.M3</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
@ -63,5 +63,15 @@
</plugins> </plugins>
</build> </build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project> </project>

View File

@ -12,9 +12,9 @@
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2.0-temp</relativePath> <relativePath>../../parent-boot-2</relativePath>
</parent> </parent>
<!-- <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <!-- <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>
@ -24,7 +24,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version> <spring-cloud.version>Greenwich.M3</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
@ -83,5 +83,16 @@
</plugins> </plugins>
</build> </build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project> </project>

View File

@ -10,10 +10,10 @@
<description>Intro to Spring Data REST</description> <description>Intro to Spring Data REST</description>
<parent> <parent>
<artifactId>parent-boot-2.0-temp</artifactId> <artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2.0-temp</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>