SearchDocument { String getName() { if (!SW360Constants.MAP_FULLTEXT_SEARCH_NAME.containsKey(type)) { return ""; } else { String name = getProperty(SW360Constants.MAP_FULLTEXT_SEARCH_NAME.get(type)); return StringUtils.abbreviate(name, NAME_MAX_LENGTH); } } SearchDocument(Map<String, Object> document);   }
@Test public void testGetName() throws Exception { assertEquals("testfullname", parser.getName()); }
@Test public void testGetNameInvalid1() throws Exception { document.remove("fullname"); parser = new SearchDocument(document); assertNotNull(parser.getName()); assertEquals("", parser.getName()); }
@Test public void testGetNameInvalid2() throws Exception { document.put("type", "feuwife"); parser = new SearchDocument(document); assertNotNull(parser.getName()); assertEquals("", parser.getName()); }