@Test
public void testParseStructuredOutputForHostCheck() {

  Resource.Type type = Resource.Type.Task;
  // Test general case
  AmbariManagementController managementController = createMock(AmbariManagementController.class);
  TaskResourceProvider taskResourceProvider = new TaskResourceProvider(
          PropertyHelper.getPropertyIds(type),
          PropertyHelper.getKeyPropertyIds(type), managementController);
  replay(managementController);
  Map<?, ?> result = taskResourceProvider.parseStructuredOutput("{\"host_resolution_check\": {\"failures\": [{\"cause\": [-2, \"Name or service not known\"], \"host\": \"foobar\", \"type\": \"FORWARD_LOOKUP\"}], \"message\": \"There were 1 host(s) that could not resolve to an IP address.\", \"failed_count\": 1, \"success_count\": 3, \"exit_code\": 0}}");
  Assert.assertNotNull(result);
  Map<?,?> host_resolution_check = (Map<?,?>)result.get("host_resolution_check");
  assertEquals(host_resolution_check.get("success_count"), 3);
  assertEquals(host_resolution_check.get("failed_count"), 1);
  verify(managementController);
}