Merge pull request #7695 from amit2103/BAEL-16767

[BAEL-16767] - Fix the integrations tests in spring-boot-ops
This commit is contained in:
Loredana Crusoveanu 2019-09-08 17:52:12 +03:00 committed by GitHub
commit 9fefbde74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 14 deletions

View File

@ -85,11 +85,17 @@
<version>${jquery.version}</version>
</dependency>
<dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<version>${springcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
</dependencies>
@ -190,7 +196,8 @@
<jpa.version>2.2</jpa.version>
<guava.version>18.0</guava.version>
<subethasmtp.version>3.1.7</subethasmtp.version>
<springcloud.version>2.0.2.RELEASE</springcloud.version>
<springcloud.version>2.0.2.RELEASE</springcloud.version>
<httpclient.version>4.5.8</httpclient.version>
</properties>
</project>

View File

@ -6,13 +6,13 @@ import org.springframework.stereotype.Component;
@Component
public class ConfProperties {
@Value("${url}")
@Value("${db.url}")
private String url;
@Value("${username}")
@Value("${db.username}")
private String username;
@Value("${password}")
@Value("${db.password}")
private String password;
public String getUrl() {

View File

@ -1,4 +1,4 @@
url=jdbc:postgresql://localhost:5432/
username=admin
password=root
db.url=jdbc:postgresql://localhost:5432/
db.username=admin
db.password=root
spring.main.allow-bean-definition-overriding=true

View File

@ -2,17 +2,16 @@ package com.baeldung.restart;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import java.time.Duration;
public class RestartApplicationIntegrationTest {
/**
* We have to make sure that while running this test, 8080 and 8090 ports are free.
* Otherwise it will fail.
*/
public class RestartApplicationManualTest {
private TestRestTemplate restTemplate = new TestRestTemplate();