MappingManagerService { public MappingModel saveMapping(String mapName, JsonNode jsonMapping) throws IOException { ObjectMapper objectMapper = new ObjectMapper(); MappingModel mapping = objectMapper.readValue(jsonMapping.toString(), MappingModel.class); MappingModel existingMapping= getMapping(mapName, false); if (existingMapping == null || existingMapping != null && !existingMapping.isEqual(mapping)) { mappingManager.saveMapping(mappingManager.createMappingFromJSON(mapping.toJson()), false); } return mapping; }  ArrayList<Mapping> getMappings(); ArrayList<String> getMappingsNames(); MappingModel saveMapping(String mapName, JsonNode jsonMapping); void deleteMapping(String mapping); MappingModel getMapping(String mappingName, boolean createIfNotExisted); JsonNode validateMapping(String jsonMapping, String uri, String db); void unsetMappingValidators();  }
@Test public void testMappingNameWithWhitespace() throws IOException { String mappingName = "test mapping"; String jsonString = "{" + " \"lang\":\"zxx\"," + " \"name\":\"" + mappingName + "\"," + " \"description\":\"\"," + " \"version\":\"0\"," + " \"targetEntityType\":\"http: " \"sourceContext\":\"\"," + " \"sourceURI\":\"\"," + " \"properties\":{}" + "}"; ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(jsonString); assertNotNull(mappingManagerService.saveMapping(mappingName, jsonNode)); }