From 1e80f98e25442b4badf570fd6ca652c21e499e28 Mon Sep 17 00:00:00 2001 From: waynedunican Date: Thu, 9 Jul 2020 13:03:28 +0100 Subject: 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 --- .../java/org/onap/policy/apex/core/deployment/BatchDeployerTest.java | 4 ++-- .../org/onap/policy/apex/core/deployment/EngineServiceFacadeTest.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'core/core-deployment/src/test') 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(); -- cgit 1.2.3-korg