Fixed or added Context Integration Tests for modules named in ticket

This commit is contained in:
Ger Roza 2019-04-01 11:33:22 -03:00
parent 1c82623201
commit b42febfd83
20 changed files with 208 additions and 26 deletions

View File

@ -1,8 +1,12 @@
package com.baeldung.spring.cloud.archaius.additionalsources.config;
import java.io.IOException;
import java.net.URL;
import org.apache.commons.configuration.AbstractConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import com.netflix.config.DynamicConfiguration;
import com.netflix.config.FixedDelayPollingScheduler;
@ -13,8 +17,9 @@ import com.netflix.config.sources.URLConfigurationSource;
public class ApplicationPropertiesConfigurations {
@Bean
public AbstractConfiguration addApplicationPropertiesSource() {
PolledConfigurationSource source = new URLConfigurationSource("classpath:other-config.properties");
public AbstractConfiguration addApplicationPropertiesSource() throws IOException {
URL configPropertyURL = (new ClassPathResource("other-config.properties")).getURL();
PolledConfigurationSource source = new URLConfigurationSource(configPropertyURL);
return new DynamicConfiguration(source, new FixedDelayPollingScheduler());
}

View File

@ -1,12 +1,10 @@
package org.baeldung;
package com.baeldung.spring.cloud.archaius.additionalsources;
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.archaius.additionalsources.AdditionalSourcesSimpleApplication;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = AdditionalSourcesSimpleApplication.class)
public class SpringContextIntegrationTest {

View File

@ -0,0 +1,15 @@
package com.baeldung.spring.cloud.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 = SpringCloudAwsApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -1,18 +1,22 @@
package com.baeldung.spring.cloud.config.server;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
/**
*
* The context will load successfully with some properties provided by docker
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = ConfigServer.class)
@WebAppConfiguration
@Ignore
public class ConfigServerListIntegrationTest {
public class SpringContextLiveTest {
@Test
public void contextLoads() {
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -21,6 +21,15 @@
<version>1.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<spring-boot.version>2.0.1.RELEASE</spring-boot.version>

View File

@ -26,12 +26,6 @@
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</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.eureka.client;
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
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -1,17 +1,16 @@
package org.baeldung;
package com.baeldung.spring.cloud.feign.client;
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.aws.InstanceProfileAwsApplication;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = InstanceProfileAwsApplication.class)
@SpringBootTest
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.eureka.server;
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
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,18 @@
package com.baeldung.spring.cloud.hystrix.rest.consumer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = RestConsumerFeignApplication.class)
@WebAppConfiguration
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -40,6 +40,13 @@
<artifactId>spring-boot-starter-actuator</artifactId>
<version>${spring-boot-starter-web.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>${spring-boot-starter-web.version}</version>
</dependency>
</dependencies>
<dependencyManagement>
@ -53,5 +60,10 @@
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<!-- we need the Mockito version provided by Spring Boot -->
<mockito.version>1.10.19</mockito.version>
</properties>
</project>

View File

@ -1,18 +1,18 @@
package org.baeldung;
package com.baeldung.spring.cloud.hystrix.rest.consumer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.baeldung.spring.cloud.config.server.ConfigServer;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = ConfigServer.class)
@ContextConfiguration(classes = RestConsumerApplication.class)
@WebAppConfiguration
public class SpringContextIntegrationTest {
@Test
public void contextLoads() {
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -20,6 +20,18 @@
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-starter-web.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot-starter-web.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<!-- we need the Mockito version provided by Spring Boot -->
<mockito.version>1.10.19</mockito.version>
</properties>
</project>

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.hystrix.rest.producer;
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
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -25,6 +25,13 @@
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-starter-web.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot-starter-web.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.eureka.client;
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
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -25,7 +25,13 @@
<artifactId>commons-configuration</artifactId>
<version>${commons-config.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot-starter-web.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.eureka.server;
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
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -33,6 +33,13 @@
<artifactId>rxjava</artifactId>
<version>${rxjava.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot-starter-web.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.cloud.zuul.config;
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
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}