fixed or added SpringContextIntegrationTests for spring cloud submodules:

spring-cloud-functions
spring-cloud-kubernetes/travel-agency-service
spring-cloud-openfeign
spring-cloud-task/springcloudtaskbatch
spring-cloud-vault
spring-cloud-zookeeper/HelloWorld
spring-cloud-zuul
This commit is contained in:
Ger Roza 2019-04-20 09:42:58 -03:00
parent ea06f79651
commit 381c6a4999
10 changed files with 132 additions and 19 deletions

View File

@ -0,0 +1,15 @@
package com.baeldung.spring.cloudfunction.aws;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = CloudFunctionAwsApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.kubernetes.travelagency;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,16 @@
package com.baeldung.cloud.openfeign;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ExampleApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -3,11 +3,11 @@ logging:
org:
springframework:
cloud:
task=DEBUG
task: DEBUG
spring:
application:
name=helloWorld
name: helloWorld
datasource:
url: jdbc:mysql://localhost:3306/springcloud?useSSL=false
username: root

View File

@ -1,17 +0,0 @@
package org.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.baeldung.task.JobConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = JobConfiguration.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,29 @@
package org.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.baeldung.task.JobConfiguration;
import com.baeldung.task.TaskDemo;
/**
* This Live Test requires:
* * a MySql instance running, that allows a root user with no password, and with a database named
*
* (e.g. with the following command `docker run -p 3306:3306 --name bael-mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true -e MYSQL_DATABASE=springcloud mysql:latest`)
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootApplication
@ContextConfiguration(classes = { JobConfiguration.class, TaskDemo.class }, initializers = {
ConfigFileApplicationContextInitializer.class })
public class SpringContextLiveTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,15 @@
package org.baeldung.spring.cloud.vaultsample;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = VaultSampleApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -34,6 +34,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.helloworld;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = HelloWorldApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,17 @@
package com.baeldung.spring.cloud.zuulratelimitdemo.controller;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.spring.cloud.zuulratelimitdemo.ZuulRatelimitDemoApplication;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ZuulRatelimitDemoApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}