Bugfix, no response sent to Dmaap for PUT
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / clients / A1ClientFactoryTest.java
index b42cebf..23cb671 100644 (file)
@@ -2,7 +2,7 @@
  * ========================LICENSE_START=================================
  * O-RAN-SC
  * %%
- * Copyright (C) 2019 Nordix Foundation
+ * Copyright (C) 2020 Nordix Foundation
  * %%
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 package org.oransc.policyagent.clients;
 
+import static ch.qos.logback.classic.Level.WARN;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
@@ -28,7 +29,6 @@ import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
 
-import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.core.read.ListAppender;
 
@@ -130,7 +130,7 @@ public class A1ClientFactoryTest {
             .expectNext(sdnrOnapA1ClientMock) //
             .verifyComplete();
 
-        assertEquals(A1ProtocolType.SDNR_ONAP, ric.getProtocolVersion(), "Not correct protocol");
+        assertEquals(A1ProtocolType.SDNC_ONAP, ric.getProtocolVersion(), "Not correct protocol");
     }
 
     @Test
@@ -140,14 +140,14 @@ public class A1ClientFactoryTest {
         whenGetProtocolVersionOscA1ClientThrowException();
         whenGetProtocolVersionStdA1ClientThrowException();
 
-        final ListAppender<ILoggingEvent> logAppender = LoggingUtils.getLogListAppender(A1ClientFactory.class);
+        final ListAppender<ILoggingEvent> logAppender = LoggingUtils.getLogListAppender(A1ClientFactory.class, WARN);
         StepVerifier.create(factoryUnderTest.createA1Client(ric)) //
             .expectSubscription() //
             .expectErrorMatches(
                 throwable -> throwable instanceof Exception && throwable.getMessage().equals(EXCEPTION_MESSAGE))
             .verify();
 
-        assertEquals(Level.WARN, logAppender.list.get(0).getLevel(), "Warning not logged");
+        assertEquals(WARN, logAppender.list.get(0).getLevel(), "Warning not logged");
         assertTrue(logAppender.list.toString().contains("Could not get protocol version from RIC: " + RIC_NAME),
             "Correct message not logged");
 
@@ -180,7 +180,7 @@ public class A1ClientFactoryTest {
 
     private void whenGetProtocolVersionSdnrOnapA1ClientReturnCorrectProtocol() {
         doReturn(sdnrOnapA1ClientMock).when(factoryUnderTest).createSdnrOnapA1Client(any(Ric.class));
-        when(sdnrOnapA1ClientMock.getProtocolVersion()).thenReturn(Mono.just(A1ProtocolType.SDNR_ONAP));
+        when(sdnrOnapA1ClientMock.getProtocolVersion()).thenReturn(Mono.just(A1ProtocolType.SDNC_ONAP));
     }
 
     private void whenGetProtocolVersionSdncOscA1ClientThrowException() {