+ @Test
+ public void testBuildPostRequest() throws JsonProcessingException, IOException, APPCException {
+ String jsonString = "{\"output\":{\"status\":{\"code\":\"200\",\"message\":\"TEST_MESSAGE\"}}}";
+ providerOperations = Mockito.spy(
+ new ProviderOperations("http://127.0.0.1", "test_user", "test_password"));
+ HttpClient httpClient = Mockito.mock(HttpClient.class);
+ HttpResponse httpResponse = Mockito.mock(HttpResponse.class);
+ StatusLine statusLine = Mockito.mock(StatusLine.class);
+ Mockito.when(statusLine.getStatusCode()).thenReturn(200);
+ Mockito.when(httpResponse.getStatusLine()).thenReturn(statusLine);
+ HttpEntity httpEntity = Mockito.mock(HttpEntity.class);
+ InputStream inputStream = new ByteArrayInputStream(jsonString.getBytes());
+ Mockito.when(httpEntity.getContent()).thenReturn(inputStream);
+ Mockito.when(httpResponse.getEntity()).thenReturn(httpEntity);
+ Mockito.when(httpClient.execute(Mockito.any())).thenReturn(httpResponse);
+ Mockito.when(providerOperations.getHttpClient()).thenReturn(httpClient);
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode jsonNode = mapper.readTree(jsonString);
+ assertEquals(ObjectNode.class, providerOperations.topologyDG(null, jsonNode).getClass());
+ }