AmUtils { public static ApiHostsRequest createInstallComponentsRequest() { ApiHostsRequest hostsRequest = new ApiHostsRequest(); ApiHostComponentsRequest components = new ApiHostComponentsRequest(); hostsRequest.setBody(components); ApiComponentInfo hostRoles = new ApiComponentInfo(); hostRoles.setState("INSTALLED"); components.setHostRoles(hostRoles); ApiHostsRequestInfo requestInfo = new ApiHostsRequestInfo(); hostsRequest.setRequestInfo(requestInfo); requestInfo.setContext("Installing components"); requestInfo.setQueryString("HostRoles/state=INIT"); return hostsRequest; }  static List<Map<String, Object>> toAmConfigurations(
         Map<String, Object> configuration); static List<Map<String, Object>> toAmConfigurations(
         List<Map<String, Object>> configurations, String configurationType,
         Map<String, String> property); static boolean isValidRack(String rack); static ApiHostsRequest createInstallComponentsRequest(); static String getConfDir(); static boolean isAmbariServerBelow_2_0_0(String ambariServerVersion); static boolean isAmbariServerGreaterOrEquals_2_1_0(String ambariServerVersion); static boolean containsRole(ClusterBlueprint blueprint, String role);  }
@Test public void testCreateInstallComponentRequest() { ApiHostsRequest request = AmUtils.createInstallComponentsRequest(); String json = ApiUtils.objectToJson(request); System.out.println("Got json: " + json); String expectedString = "{\"Body\":{\"HostRoles\":{\"state\":\"INSTALLED\"}},\"RequestInfo\":{\"context\":\"Installing components\",\"query\":\"HostRoles/state=INIT\"}}"; }