- public void startup_unableToConnectToGetPolicies() {
- Vector<RicConfig> ricConfigs = new Vector<>(2);
- ricConfigs.add(getRicConfig(FIRST_RIC_NAME, FIRST_RIC_URL, MANAGED_NODE_A));
- ricConfigs.add(getRicConfig(SECOND_RIC_NAME, SECOND_RIC_URL, MANAGED_NODE_B, MANAGED_NODE_C));
- when(appConfigMock.getRicConfigs()).thenReturn(ricConfigs);
-
- Flux<String> fluxType1 = Flux.just(POLICY_TYPE_1_NAME);
- Flux<String> fluxType2 = Flux.just(POLICY_TYPE_2_NAME);
- when(a1ClientMock.getPolicyTypeIdentities(anyString())).thenReturn(fluxType1)
- .thenReturn(fluxType1.concatWith(fluxType2));
- 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());
+ public void startup_unableToConnectToDeleteAllPolicies() {
+
+ Mono<List<String>> policyTypes = Mono.just(Arrays.asList(POLICY_TYPE_1_NAME));
+ when(a1ClientMock.getPolicyTypeIdentities()).thenReturn(policyTypes);
+ when(a1ClientMock.getPolicyTypeSchema(anyString())).thenReturn(Mono.just("Schema"));
+ Flux<?> error = Flux.error(new Exception("Unable to contact ric."));
+ doReturn(error).when(a1ClientMock).deleteAllPolicies();