Updates of the NBI
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / tasks / StartupServiceTest.java
index 10c3271..5cfabd9 100644 (file)
@@ -33,6 +33,7 @@ import static org.oransc.policyagent.repository.Ric.RicState.ACTIVE;
 import static org.oransc.policyagent.repository.Ric.RicState.NOT_REACHABLE;
 
 import java.util.Vector;
+
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.runner.RunWith;
@@ -46,6 +47,7 @@ import org.oransc.policyagent.configuration.RicConfig;
 import org.oransc.policyagent.repository.PolicyTypes;
 import org.oransc.policyagent.repository.Ric;
 import org.oransc.policyagent.repository.Rics;
+
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 
@@ -84,7 +86,8 @@ public class StartupServiceTest {
             .thenReturn(fluxType1.concatWith(fluxType2));
         Flux<String> policies = Flux.just(new String[] {POLICY_ID_1, POLICY_ID_2});
         when(a1ClientMock.getPolicyIdentities(anyString())).thenReturn(policies);
-        when(a1ClientMock.deletePolicy(anyString(), anyString())).thenReturn(Mono.empty());
+        when(a1ClientMock.getPolicyType(anyString(), anyString())).thenReturn(Mono.just("Schema"));
+        when(a1ClientMock.deletePolicy(anyString(), anyString())).thenReturn(Mono.just("OK"));
 
         Rics rics = new Rics();
         PolicyTypes policyTypes = new PolicyTypes();
@@ -146,7 +149,8 @@ public class StartupServiceTest {
 
         Flux<String> policies = Flux.just(new String[] {POLICY_ID_1, POLICY_ID_2});
         doReturn(policies).when(a1ClientMock).getPolicyIdentities(anyString());
-        when(a1ClientMock.deletePolicy(anyString(), anyString())).thenReturn(Mono.empty());
+        when(a1ClientMock.getPolicyType(anyString(), anyString())).thenReturn(Mono.just("Schema"));
+        when(a1ClientMock.deletePolicy(anyString(), anyString())).thenReturn(Mono.just("OK"));
 
         Rics rics = new Rics();
         PolicyTypes policyTypes = new PolicyTypes();
@@ -173,10 +177,11 @@ public class StartupServiceTest {
         Flux<String> fluxType2 = Flux.just(POLICY_TYPE_2_NAME);
         when(a1ClientMock.getPolicyTypeIdentities(anyString())).thenReturn(fluxType1)
             .thenReturn(fluxType1.concatWith(fluxType2));
+        when(a1ClientMock.getPolicyType(anyString(), anyString())).thenReturn(Mono.just("Schema"));
         Flux<String> policies = Flux.just(new String[] {POLICY_ID_1, POLICY_ID_2});
         doReturn(Flux.error(new Exception("Unable to contact ric.")), policies).when(a1ClientMock)
             .getPolicyIdentities(anyString());
-        when(a1ClientMock.deletePolicy(anyString(), anyString())).thenReturn(Mono.empty());
+        when(a1ClientMock.deletePolicy(anyString(), anyString())).thenReturn(Mono.just("OK"));
 
         Rics rics = new Rics();
         PolicyTypes policyTypes = new PolicyTypes();