X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Ftasks%2FStartupServiceTest.java;h=5cfabd9cce56e156d1c4226596d14d9fe9caf5e5;hb=a76d95e9292f99dfb5cd5782ef6d7bb2ec293fd7;hp=10c3271c03f1b8d62d2bd4343e1fcf4faf995b14;hpb=e6f2305abd791d003d4729c3bd8c8652d89eed70;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/tasks/StartupServiceTest.java b/policy-agent/src/test/java/org/oransc/policyagent/tasks/StartupServiceTest.java index 10c3271c..5cfabd9c 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/tasks/StartupServiceTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/tasks/StartupServiceTest.java @@ -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 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 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 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 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();