diff options
author | waynedunican <wayne.dunican@est.tech> | 2020-07-09 13:03:28 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2020-07-23 11:46:15 +0100 |
commit | 1e80f98e25442b4badf570fd6ca652c21e499e28 (patch) | |
tree | d180015f37854f69f5365111a3ec81ea8d0c302a /core/core-deployment | |
parent | d19067ce13765b7f98bcefb26b1bb469282c6624 (diff) |
Remove try/catch blocks with assertj - apex-pdp
Removed try/catch blocks in apex-pdp and replaced with assertj
assertions Part III
Issue-ID: POLICY-2451
Change-Id: I1e6ede1c256c5bcf7899e1af130add71fdf1381c
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'core/core-deployment')
2 files changed, 5 insertions, 2 deletions
diff --git a/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/BatchDeployerTest.java b/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/BatchDeployerTest.java index ab44f900d..7e17cacdc 100644 --- a/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/BatchDeployerTest.java +++ b/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/BatchDeployerTest.java @@ -78,7 +78,7 @@ public class BatchDeployerTest { assertThatThrownBy(deployer::init).hasMessage("model deployment failed on parameters localhost 12345"); // Wait until the connection to the server closes following the bad connection // attempt - Awaitility.await().atLeast(Duration.ofMillis(100)); + Awaitility.await().atLeast(Duration.ofMillis(500)); // We are testing towards a dummy client, make it return a successful initiation dummyDeploymentClient.setInitSuccessful(true); @@ -105,7 +105,7 @@ public class BatchDeployerTest { .hasMessage("model deployment failed on parameters localhost 12345"); // Wait until the connection to the server closes following the bad connection // attempt - Awaitility.await().atLeast(Duration.ofMillis(100)); + Awaitility.await().atLeast(Duration.ofMillis(500)); dummyDeploymentClient.setInitSuccessful(true); diff --git a/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/EngineServiceFacadeTest.java b/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/EngineServiceFacadeTest.java index 6e0826c3f..1740c7e55 100644 --- a/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/EngineServiceFacadeTest.java +++ b/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/EngineServiceFacadeTest.java @@ -27,6 +27,8 @@ import static org.junit.Assert.assertNull; import java.io.ByteArrayInputStream; import java.io.InputStream; +import java.time.Duration; +import org.awaitility.Awaitility; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -54,6 +56,7 @@ public class EngineServiceFacadeTest { .hasMessage("could not deploy apex model, deployer is not initialized"); // Second init should work + Awaitility.await().atLeast(Duration.ofMillis(1000)); dummyDeploymentClient.setInitSuccessful(true); facade.init(); |