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=cdf614c2a31f671a925168bf8c70c3dad927603d;hb=e2a037745508a3c1ada650ea3571ca57f0a90851;hp=efbd57656f987d198c763d0c8ee72be2a09e58ce;hpb=c5c251953f36a3a56613ad28f2d73f958ff58295;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..cdf614c2 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/MockPolicyAgent.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/MockPolicyAgent.java @@ -123,20 +123,17 @@ public class MockPolicyAgent { logger.error("Could not load json schema ", e); } } + policyTypes.put(ImmutablePolicyType.builder().name("").schema("{}").build()); } } @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 +144,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();