ResourceInstanceFactoryImpl implements ResourceInstanceFactory { @Override public ResourceInstance createResource(Resource.Type type, Map<Resource.Type, String> mapIds) { try { if (mapIds.containsKey(Resource.Type.Host)) { String hostName = mapIds.get(Resource.Type.Host); if (hostName != null) { mapIds.put(Resource.Type.Host, hostName.toLowerCase()); } } } catch(Exception e) { LOG.error("Lowercase host name value in resource failed with error:" + e); } ResourceDefinition resourceDefinition = getResourceDefinition(type, mapIds); return new QueryImpl(mapIds, resourceDefinition, ClusterControllerHelper.getClusterController()); }  @Override ResourceInstance createResource(Resource.Type type, Map<Resource.Type, String> mapIds); static void addResourceDefinition(Resource.Type type, ResourceDefinition definition); static ResourceDefinition getResourceDefinition(Resource.Type type, Map<Resource.Type, String> mapIds);  }
@Test public void testGetHostDefinition() { ResourceInstanceFactoryImpl resourceInstanceFactory = new ResourceInstanceFactoryImpl(); Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Host, "TeSTHost1"); ResourceInstance resourceInstance = resourceInstanceFactory.createResource( Resource.Type.Host, mapIds); assertEquals(mapIds.get(Resource.Type.Host), "testhost1"); }