X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-sim%2Fpolicy-models-simulators%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Fsimulators%2FMainTest.java;h=09064f472e2363756ec0379006f5c606b9141e52;hb=49f07db935d114b72a44e446867b16262dd552aa;hp=e1517f3a8da500fc5824117b873a9664789f7d65;hpb=72f56e3460484a922f0bd19b9ef3eda868b34f6c;p=policy%2Fmodels.git diff --git a/models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java b/models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java index e1517f3a8..09064f472 100644 --- a/models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java +++ b/models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +31,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import jakarta.ws.rs.core.Response; import java.io.FileNotFoundException; import java.io.IOException; import java.util.HashMap; @@ -39,7 +41,6 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import javax.ws.rs.core.Response; import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -112,14 +113,8 @@ public class MainTest { } } - @Test - public void testConstructor() throws Exception { - assertThatIllegalArgumentException().isThrownBy(() -> new Main("invalidDmaapProvider.json")) - .withMessage("invalid simulator parameters"); - } - /** - * Verifies that all of the simulators are brought up and that HTTPS works with at + * Verifies that all the simulators are brought up and that HTTPS works with at * least one of them. */ @Test @@ -223,7 +218,7 @@ public class MainTest { } }; - // run in another thread so we don't interrupt this thread + // run in another thread, so we don't interrupt this thread LinkedBlockingQueue queue = new LinkedBlockingQueue<>(); Thread thread = new Thread(() -> { try { @@ -242,30 +237,5 @@ public class MainTest { assertThat(ex.getCause()).hasMessageStartingWith("interrupted while building"); } - /** - * Tests buildTopicServer() when the provider class is invalid. - */ - @Test - public void testBuildTopicServerInvalidProvider() { - assertThatThrownBy(() -> new Main("invalidTopicServer.json").start()) - .hasCauseInstanceOf(IllegalArgumentException.class); - } - - /** - * Tests buildTopicServer() when the sink is missing. - */ - @Test - public void testBuildTopicServerNoSink() { - assertThatThrownBy(() -> new Main("missingSink.json").start()) - .hasCauseInstanceOf(IllegalArgumentException.class); - } - /** - * Tests buildTopicServer() when the sink is missing. - */ - @Test - public void testBuildTopicServerNoSource() { - assertThatThrownBy(() -> new Main("missingSource.json").start()) - .hasCauseInstanceOf(IllegalArgumentException.class); - } }