+ public void testGetPolicyTypeIdentities_OSC() {
+ clientUnderTest = new SdncOscA1Client(A1ProtocolType.SDNC_OSC_OSC_V1, //
+ A1ClientHelper.createRic(RIC_1_URL).getConfig(), //
+ controllerConfig(), asyncRestClientMock);
+
+ String response = createResponse(Arrays.asList(POLICY_TYPE_1_ID));
+ whenAsyncPostThenReturn(Mono.just(response));
+
+ List<String> policyTypeIds = clientUnderTest.getPolicyTypeIdentities().block();
+ assertEquals(1, policyTypeIds.size(), "");
+ assertEquals(POLICY_TYPE_1_ID, policyTypeIds.get(0), "");
+
+ String expUrl = RIC_1_URL + "/a1-p/policytypes";
+ AdapterRequest expectedParams = ImmutableAdapterRequest.builder() //
+ .nearRtRicUrl(expUrl) //
+ .build();
+ String expInput = SdncJsonHelper.createInputJsonString(expectedParams);
+ verify(asyncRestClientMock).postWithAuthHeader(GET_A1_POLICY_URL, expInput, CONTROLLER_USERNAME,
+ CONTROLLER_PASSWORD);
+
+ }
+
+ private String policiesUrl() {
+ return RIC_1_URL + "/A1-P/v1/policies";
+ }
+
+ private Gson gson() {
+ return SdncOscA1Client.gson;
+ }
+
+ private String createResponse(Object obj) {
+ AdapterResponse output = ImmutableAdapterResponse.builder() //
+ .body(gson().toJson(obj)) //
+ .httpStatus(200) //