Skip cross account tests if no cross account credentials are provided (#1321)
This commit is contained in:
parent
34fe58c492
commit
ab24b66039
1 changed files with 4 additions and 8 deletions
|
|
@ -44,6 +44,8 @@ import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TestConsumer {
|
public class TestConsumer {
|
||||||
public final KCLAppConfig consumerConfig;
|
public final KCLAppConfig consumerConfig;
|
||||||
|
|
@ -79,8 +81,9 @@ public class TestConsumer {
|
||||||
|
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
|
|
||||||
|
// Skip cross account tests if no cross account credentials are provided
|
||||||
if (consumerConfig.isCrossAccount()) {
|
if (consumerConfig.isCrossAccount()) {
|
||||||
verifyCrossAccountCreds();
|
assumeTrue(consumerConfig.getCrossAccountCredentialsProvider() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
final StreamExistenceManager streamExistenceManager = new StreamExistenceManager(this.consumerConfig);
|
final StreamExistenceManager streamExistenceManager = new StreamExistenceManager(this.consumerConfig);
|
||||||
|
|
@ -126,13 +129,6 @@ public class TestConsumer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyCrossAccountCreds() {
|
|
||||||
if (consumerConfig.getCrossAccountCredentialsProvider() == null) {
|
|
||||||
throw new RuntimeException("To run cross account integration tests, pass in an AWS profile with -D" +
|
|
||||||
KCLAppConfig.CROSS_ACCOUNT_PROFILE_PROPERTY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cleanTestResources(StreamExistenceManager streamExistenceManager, LeaseTableManager leaseTableManager) throws Exception {
|
private void cleanTestResources(StreamExistenceManager streamExistenceManager, LeaseTableManager leaseTableManager) throws Exception {
|
||||||
log.info("----------Before starting, Cleaning test environment----------");
|
log.info("----------Before starting, Cleaning test environment----------");
|
||||||
log.info("----------Deleting all lease tables in account----------");
|
log.info("----------Deleting all lease tables in account----------");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue