- private void whenGetProtocolVersionSdnrOnapA1ClientThrowException() {
- doReturn(sdnrOnapA1ClientMock).when(factoryUnderTest).createSdnrOnapA1Client(ric);
- when(sdnrOnapA1ClientMock.getProtocolVersion()).thenReturn(Mono.error(new Exception(EXCEPTION_MESSAGE)));
- }
-
- private void whenGetProtocolVersionSdnrOnapA1ClientReturnCorrectProtocol() {
- doReturn(sdnrOnapA1ClientMock).when(factoryUnderTest).createSdnrOnapA1Client(any(Ric.class));
- when(sdnrOnapA1ClientMock.getProtocolVersion()).thenReturn(Mono.just(A1ProtocolType.SDNR_ONAP));
- }
-
- private void whenGetProtocolVersionSdncOscA1ClientThrowException() {
- doReturn(sdncOscA1ClientMock).when(factoryUnderTest).createSdncOscA1Client(any(Ric.class));
- when(sdncOscA1ClientMock.getProtocolVersion()).thenReturn(Mono.error(new Exception(EXCEPTION_MESSAGE)));
- }
-
- private void whenGetProtocolVersionSdncOscA1ClientReturnCorrectProtocol() {
- doReturn(sdncOscA1ClientMock).when(factoryUnderTest).createSdncOscA1Client(any(Ric.class));
- when(sdncOscA1ClientMock.getProtocolVersion()).thenReturn(Mono.just(A1ProtocolType.SDNC_OSC));
- }
-
- private void whenGetProtocolVersionOscA1ClientThrowException() {
- doReturn(oscA1ClientMock).when(factoryUnderTest).createOscA1Client(any(Ric.class));
- when(oscA1ClientMock.getProtocolVersion()).thenReturn(Mono.error(new Exception(EXCEPTION_MESSAGE)));
+ @Test
+ public void create_check_types() {
+ assertTrue(createClient(A1ProtocolType.STD_V1_1) instanceof StdA1ClientVersion1);
+ assertTrue(createClient(A1ProtocolType.OSC_V1) instanceof OscA1Client);
+ assertTrue(createClient(A1ProtocolType.SDNC_ONAP) instanceof SdncOnapA1Client);
+ assertTrue(createClient(A1ProtocolType.SDNC_OSC) instanceof SdncOscA1Client);
+ assertTrue(createClient(A1ProtocolType.UNKNOWN) == null);