### Question:
ServicePluginFactory { @SuppressWarnings("unchecked") public String doProcessSiteLocation(ServiceDecomposition serviceDecomposition, String uuiRequest) { if (!isNeedProcessSite(uuiRequest)) { return uuiRequest; } Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class); if (uuiObject == null) { return uuiRequest; } Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.getOrDefault("service", Collections.emptyMap()); Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.getOrDefault("parameters", Collections.emptyMap()); Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.getOrDefault("requestInputs", Collections.emptyMap()); List<Object> resources = (List<Object>) serviceParametersObject.getOrDefault("resources", Collections.emptyList()); if (isSiteLocationLocal(serviceRequestInputs, resources)) { return getJsonString(uuiObject); } List<Resource> addResourceList = new ArrayList<>(); addResourceList.addAll(serviceDecomposition.getServiceResources()); serviceDecomposition.setVnfResources(null); serviceDecomposition.setAllottedResources(null); serviceDecomposition.setNetworkResources(null); serviceDecomposition.setConfigResources(null); for (Resource resource : addResourceList) { String resourcemodelName = resource.getModelInfo().getModelName(); if (StringUtils.containsIgnoreCase(resourcemodelName, "sppartner")) { serviceDecomposition.addResource(resource); break; } } return uuiRequest; } private  ServicePluginFactory(); static synchronized ServicePluginFactory getInstance(); @SuppressWarnings("unchecked") String doProcessSiteLocation(ServiceDecomposition serviceDecomposition, String uuiRequest); @SuppressWarnings("unchecked") String doTPResourcesAllocation(DelegateExecution execution, String uuiRequest); Map getTPsfromAAI(String serviceName); String preProcessService(ServiceDecomposition serviceDecomposition, String uuiRequest); String doServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest); static void main(String args[]); static String getJsonString(Object srcObj);  }### Answer:
@Test public void doProcessSiteLocation_isNeedProcessSite() { String result = servicePluginFactory.doProcessSiteLocation(serviceDecomposition, uuiRequest); Assert.assertEquals(result, uuiRequest); }
@Test public void doProcessSiteLocation_uuiObjectNull() { String faultyJsonInput = "site_address,sotncondition_clientsignal"; String result = servicePluginFactory.doProcessSiteLocation(serviceDecomposition, faultyJsonInput); Assert.assertEquals(result, faultyJsonInput); }
@Test public void doProcessSiteLocation_isSiteLocationLocal() { String jsonWithOnlyNeededValues = "{\"site_address\":\"\",\"sotncondition_clientsignal\":\"\"}"; String result = servicePluginFactory.doProcessSiteLocation(serviceDecomposition, jsonWithOnlyNeededValues); Assert.assertEquals(result, jsonWithOnlyNeededValues); }