Fixed Integration Tests for spring-cloud submodules:

* spring-cloud-archaius/basic-config
* spring-cloud-aws
* spring-cloud-bootstrap projects
This commit is contained in:
Ger Roza
2019-04-15 10:00:31 -03:00
parent e41d832038
commit ea06f79651
22 changed files with 97 additions and 41 deletions

View File

@@ -8,7 +8,7 @@
#### Running the Integration Tests
To run the Integration Tests, we need to have an AWS account and have API keys generated for programmatic access. Edit
To run the Live Tests, we need to have an AWS account and have API keys generated for programmatic access. Edit
the `application.properties` file to add the following properties:
```

View File

@@ -5,9 +5,16 @@ import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
*
* To run this Live Test, we need to have an AWS account and have API keys generated for programmatic access.
*
* Check the README file in this module for more information.
*
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringCloudAwsApplication.class)
public class SpringContextIntegrationTest {
public class SpringContextLiveTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {

View File

@@ -16,12 +16,19 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.ec2.AmazonEC2;
/**
*
* To run this Live Test, we need to have an AWS account and have API keys generated for programmatic access.
*
* Check the README file in this module for more information.
*
*/
@SpringBootTest
@RunWith(SpringRunner.class)
@TestPropertySource("classpath:application-test.properties")
public class EC2MetadataIntegrationTest {
public class EC2MetadataLiveTest {
private static final Logger logger = LoggerFactory.getLogger(EC2MetadataIntegrationTest.class);
private static final Logger logger = LoggerFactory.getLogger(EC2MetadataLiveTest.class);
private boolean serverEc2;

View File

@@ -14,9 +14,16 @@ import java.sql.Statement;
import static org.assertj.core.api.Assertions.assertThat;
/**
*
* To run this Live Test, we need to have an AWS account and have API keys generated for programmatic access.
*
* Check the README file in this module for more information.
*
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class SpringCloudRDSIntegrationTest {
public class SpringCloudRDSLiveTest {
@Autowired
DataSource dataSource;

View File

@@ -23,10 +23,17 @@ import java.util.UUID;
import static org.assertj.core.api.Assertions.assertThat;
/**
*
* To run this Live Test, we need to have an AWS account and have API keys generated for programmatic access.
*
* Check the README file in this module for more information.
*
*/
@SpringBootTest
@RunWith(SpringRunner.class)
@TestPropertySource("classpath:application-test.properties")
public class SpringCloudS3IntegrationTest {
public class SpringCloudS3LiveTest {
@Autowired
private SpringCloudS3 springCloudS3;

View File

@@ -16,10 +16,17 @@ import com.amazonaws.services.sns.model.CreateTopicResult;
import com.baeldung.spring.cloud.aws.SpringCloudAwsTestUtil;
import com.baeldung.spring.cloud.aws.sqs.Greeting;
/**
*
* To run this Live Test, we need to have an AWS account and have API keys generated for programmatic access.
*
* Check the README file in this module for more information.
*
*/
@SpringBootTest
@RunWith(SpringRunner.class)
@TestPropertySource("classpath:application-test.properties")
public class SpringCloudSNSIntegrationTest {
public class SpringCloudSNSLiveTest {
@Autowired
private SNSMessageSender snsMessageSender;

View File

@@ -26,12 +26,19 @@ import java.util.concurrent.CountDownLatch;
import static org.assertj.core.api.Assertions.assertThat;
/**
*
* To run this Live Test, we need to have an AWS account and have API keys generated for programmatic access.
*
* Check the README file in this module for more information.
*
*/
@SpringBootTest
@RunWith(SpringRunner.class)
@TestPropertySource("classpath:application-test.properties")
public class SpringCloudSQSIntegrationTest {
public class SpringCloudSQSLiveTest {
private static final Logger logger = LoggerFactory.getLogger(SpringCloudSQSIntegrationTest.class);
private static final Logger logger = LoggerFactory.getLogger(SpringCloudSQSLiveTest.class);
@Autowired
@Lazy