@Test public void shouldReturnEmptyStringForInvalidContentSection() { String atomFeedData = "{\"code\":\"12312\"}"; String atomFeedContentValue = "[" + atomFeedData + "]"; assertThat(vendorEventFeedService.parseAtomFeedContent(atomFeedContentValue), is(EMPTY)); }
String parseAtomFeedContent(String atomFeedContentValue) { Matcher matcher = XML_CDATA_PATTERN.matcher(atomFeedContentValue); String atomFeedContent = EMPTY; if (matcher.find() && matcher.groupCount() == 1) { atomFeedContent = matcher.group(1); } return atomFeedContent; }
VendorEventFeedService { String parseAtomFeedContent(String atomFeedContentValue) { Matcher matcher = XML_CDATA_PATTERN.matcher(atomFeedContentValue); String atomFeedContent = EMPTY; if (matcher.find() && matcher.groupCount() == 1) { atomFeedContent = matcher.group(1); } return atomFeedContent; } }
VendorEventFeedService { String parseAtomFeedContent(String atomFeedContentValue) { Matcher matcher = XML_CDATA_PATTERN.matcher(atomFeedContentValue); String atomFeedContent = EMPTY; if (matcher.find() && matcher.groupCount() == 1) { atomFeedContent = matcher.group(1); } return atomFeedContent; }  }
VendorEventFeedService { String parseAtomFeedContent(String atomFeedContentValue) { Matcher matcher = XML_CDATA_PATTERN.matcher(atomFeedContentValue); String atomFeedContent = EMPTY; if (matcher.find() && matcher.groupCount() == 1) { atomFeedContent = matcher.group(1); } return atomFeedContent; }  String getRecentFeed(String requestURL, String vendor, String category); String getEventFeed(String requestURL, String vendor, String category, int feedNumber); }
VendorEventFeedService { String parseAtomFeedContent(String atomFeedContentValue) { Matcher matcher = XML_CDATA_PATTERN.matcher(atomFeedContentValue); String atomFeedContent = EMPTY; if (matcher.find() && matcher.groupCount() == 1) { atomFeedContent = matcher.group(1); } return atomFeedContent; }  String getRecentFeed(String requestURL, String vendor, String category); String getEventFeed(String requestURL, String vendor, String category, int feedNumber);  }