- void testGetValidPolicyType() {
- String policyType = clientUnderTest.getPolicyTypeSchema("").block();
- assertEquals("{}", policyType, "");
+ void getPolicyIdentities_OSC() {
+ clientUnderTest = new SdncOscA1Client(A1ProtocolType.SDNC_OSC_OSC_V1, //
+ A1ClientHelper.createRic(RIC_1_URL).getConfig(), //
+ controllerConfig(), asyncRestClientMock);
+
+ String policytypeIdsResp = createOkResponseWithBody(Arrays.asList(POLICY_TYPE_1_ID));
+ String policyIdsResp = createOkResponseWithBody(Arrays.asList(POLICY_1_ID, POLICY_2_ID));
+ whenAsyncPostThenReturn(Mono.just(policytypeIdsResp)).thenReturn(Mono.just(policyIdsResp));
+
+ List<String> returned = clientUnderTest.getPolicyIdentities().block();
+
+ assertEquals(2, returned.size());
+
+ ImmutableAdapterRequest expectedParams = ImmutableAdapterRequest.builder() //
+ .nearRtRicUrl(RIC_1_URL + "/a1-p/policytypes/type1/policies") //
+ .build();
+ String expInput = SdncJsonHelper.createInputJsonString(expectedParams);
+ verify(asyncRestClientMock).postWithAuthHeader(GET_A1_POLICY_URL, expInput, CONTROLLER_USERNAME,
+ CONTROLLER_PASSWORD);