* 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.
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;
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;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
/**
* Saves system properties.
*/
- @Ignore
@BeforeClass
public static void setUpBeforeClass() throws IOException, InterruptedException {
savedValues = new HashMap<>();
/**
* Restores system properties.
*/
- @Ignore
@AfterClass
public static void tearDownAfterClass() {
for (Entry<String, String> ent : savedValues.entrySet()) {
/**
* Shuts down the simulator instance.
*/
- @Ignore
@After
public void tearDown() {
Main main = Main.getInstance();
}
}
- @Ignore
- @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.
*/
- @Ignore
@Test
public void testMain() throws Exception {
Main.main(new String[0]);
checkAai();
}
- @Ignore
@Test
public void testMainMinimalParameters() {
Main.main(new String[] {"minParameters.json"});
/**
* Tests readParameters() when the file cannot be found.
*/
- @Ignore
@Test
public void testReadParametersNoFile() {
assertThatIllegalArgumentException().isThrownBy(() -> new Main("missing-file.json"))
/**
* Tests readParameters() when the json cannot be decoded.
*/
- @Ignore
@Test
public void testReadParametersInvalidJson() throws CoderException {
Coder coder = mock(Coder.class);
/**
* Tests buildRestServer() when the server port is not open.
*/
- @Ignore
@Test
public void testBuildRestServerNotOpen() {
HttpServletServer server = mock(HttpServletServer.class);
/**
* Tests buildRestServer() when the port checker is interrupted.
*/
- @Ignore
@Test
public void testBuildRestServerInterrupted() throws InterruptedException {
HttpServletServer server = mock(HttpServletServer.class);
}
};
- // run in another thread so we don't interrupt this thread
+ // run in another thread, so we don't interrupt this thread
LinkedBlockingQueue<RuntimeException> queue = new LinkedBlockingQueue<>();
Thread thread = new Thread(() -> {
try {
assertThat(ex.getCause()).hasMessageStartingWith("interrupted while building");
}
- /**
- * Tests buildTopicServer() when the provider class is invalid.
- */
- @Ignore
- @Test
- public void testBuildTopicServerInvalidProvider() {
- assertThatThrownBy(() -> new Main("invalidTopicServer.json").start())
- .hasCauseInstanceOf(IllegalArgumentException.class);
- }
-
- /**
- * Tests buildTopicServer() when the sink is missing.
- */
- @Ignore
- @Test
- public void testBuildTopicServerNoSink() {
- assertThatThrownBy(() -> new Main("missingSink.json").start())
- .hasCauseInstanceOf(IllegalArgumentException.class);
- }
- /**
- * Tests buildTopicServer() when the sink is missing.
- */
- @Ignore
- @Test
- public void testBuildTopicServerNoSource() {
- assertThatThrownBy(() -> new Main("missingSource.json").start())
- .hasCauseInstanceOf(IllegalArgumentException.class);
- }
}