X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2FMockPolicyAgent.java;h=2b66a353c94006666d564dd8d137080e7df106cc;hb=e0fab9aec406c7d9d6e34c5a94cbe7341a99ceb7;hp=efbd57656f987d198c763d0c8ee72be2a09e58ce;hpb=136e826cabebb7e4188c68ec118bb11632f8139a;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/MockPolicyAgent.java b/policy-agent/src/test/java/org/oransc/policyagent/MockPolicyAgent.java index efbd5765..2b66a353 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/MockPolicyAgent.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/MockPolicyAgent.java @@ -129,14 +129,10 @@ public class MockPolicyAgent { @LocalServerPort private int port; - private void keepServerAlive() { + private void keepServerAlive() throws InterruptedException { logger.info("Keeping server alive!"); - try { - synchronized (this) { - this.wait(); - } - } catch (Exception ex) { - logger.error("Unexpected: " + ex); + synchronized (this) { + this.wait(); } } @@ -147,7 +143,8 @@ public class MockPolicyAgent { } @Test - @SuppressWarnings("squid:S2699") // Tests should include assertions. This test is only for keeping the server alive, + @SuppressWarnings("squid:S2699") // Tests should include assertions. This test is only for keeping the server + // alive, // so it will only be confusing to add an assertion. public void runMock() throws Exception { keepServerAlive();