- @Test
- public void createWithProtocolInRic_noTrialAndError() {
- doReturn(stdA1ClientMock).when(factoryUnderTest).createStdA1ClientImpl(any(Ric.class));
-
- ric.setProtocolVersion(A1ProtocolType.STD_V1);
-
- StepVerifier.create(factoryUnderTest.createA1Client(ric)) //
- .expectSubscription() //
- .expectNext(stdA1ClientMock) //
- .verifyComplete();
-
- assertEquals(A1ProtocolType.STD_V1, ric.getProtocolVersion(), "Not correct protocol");
-
- verifyNoMoreInteractions(sdnrOnapA1ClientMock);
- verifyNoMoreInteractions(sdncOscA1ClientMock);
- verifyNoMoreInteractions(oscA1ClientMock);
- verifyNoMoreInteractions(stdA1ClientMock);
- }
-
- 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));