X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Fclients%2FA1ClientFactoryTest.java;h=74cebb05b4fdaff46c26a73e37ab1ba504d78e59;hb=6116e98837066075013c5ee22b39a2df4ff604ea;hp=742734e5df774e75fc6256833f13ec85dce235b8;hpb=254eab2d525ad00ac092d6859d21cbab8e42746a;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientFactoryTest.java b/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientFactoryTest.java index 742734e5..74cebb05 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientFactoryTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientFactoryTest.java @@ -46,7 +46,7 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @ExtendWith(MockitoExtension.class) -public class A1ClientFactoryTest { +class A1ClientFactoryTest { private static final String RIC_NAME = "Name"; private static final String EXCEPTION_MESSAGE = "Error"; @@ -78,14 +78,14 @@ public class A1ClientFactoryTest { } @BeforeEach - public void createFactoryUnderTest() { + void createFactoryUnderTest() { factoryUnderTest = spy(new A1ClientFactory(applicationConfigMock)); this.ric = new Ric(ricConfig("")); } @Test - public void getProtocolVersion_ok() throws ServiceException { + void getProtocolVersion_ok() throws ServiceException { whenGetProtocolVersionThrowException(clientMock1); whenGetProtocolVersionReturn(clientMock2, A1ProtocolType.STD_V1_1); doReturn(clientMock1, clientMock2).when(factoryUnderTest).createClient(any(), any()); @@ -97,7 +97,7 @@ public class A1ClientFactoryTest { } @Test - public void getProtocolVersion_ok_Last() throws ServiceException { + void getProtocolVersion_ok_Last() throws ServiceException { whenGetProtocolVersionThrowException(clientMock1, clientMock2, clientMock3); whenGetProtocolVersionReturn(clientMock4, A1ProtocolType.STD_V1_1); doReturn(clientMock1, clientMock2, clientMock3, clientMock4).when(factoryUnderTest).createClient(any(), any()); @@ -109,16 +109,16 @@ public class A1ClientFactoryTest { } @Test - public void getProtocolVersion_error() throws ServiceException { + void getProtocolVersion_error() throws ServiceException { whenGetProtocolVersionThrowException(clientMock1, clientMock2, clientMock3, clientMock4); doReturn(clientMock1, clientMock2, clientMock3, clientMock4).when(factoryUnderTest).createClient(any(), any()); StepVerifier.create(factoryUnderTest.createA1Client(ric)) // .expectSubscription() // - .expectErrorMatches(throwable -> throwable.getMessage().equals(EXCEPTION_MESSAGE)) // + .expectError() // .verify(); - assertEquals(A1ProtocolType.UNKNOWN, ric.getProtocolVersion(), "Not correct protocol"); + assertEquals(A1ProtocolType.UNKNOWN, ric.getProtocolVersion(), "Protocol negotiation failed for " + ric.name()); } private A1Client createClient(A1ProtocolType version) throws ServiceException { @@ -126,13 +126,13 @@ public class A1ClientFactoryTest { } @Test - public void create_check_types() throws ServiceException { + void create_check_types() throws ServiceException { assertTrue(createClient(A1ProtocolType.STD_V1_1) instanceof StdA1ClientVersion1); assertTrue(createClient(A1ProtocolType.OSC_V1) instanceof OscA1Client); } @Test - public void create_check_types_controllers() throws ServiceException { + void create_check_types_controllers() throws ServiceException { this.ric = new Ric(ricConfig("anythingButEmpty")); whenGetGetControllerConfigReturn(); assertTrue(createClient(A1ProtocolType.SDNC_ONAP) instanceof SdncOnapA1Client);