@Test void listFundedNotificationChannels() throws IOException { final String json = "json"; final List<String> expectedChannels = Arrays.asList("FundRequest/funded-requests-test", "FundRequest/funded-requests", "FundRequest/funded-requests-blablabla"); final GitterRooms gitterRooms = new GitterRooms(); gitterRooms.setFundedNotification(expectedChannels); when(githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath)).thenReturn(json); when(objectMapper.readValue(json, GitterRooms.class)).thenReturn(gitterRooms); final List<String> result = gitterService.listFundedNotificationRooms(); assertThat(result).isEqualTo(expectedChannels); }
@Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); return gitterRooms.getFundedNotification(); } catch (IOException e) { throw new RuntimeException(e); } }
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); return gitterRooms.getFundedNotification(); } catch (IOException e) { throw new RuntimeException(e); } } }
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); return gitterRooms.getFundedNotification(); } catch (IOException e) { throw new RuntimeException(e); } } GitterService(final GithubRawClient githubRawClient, final String branch, final String path, final ObjectMapper objectMapper); }
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); return gitterRooms.getFundedNotification(); } catch (IOException e) { throw new RuntimeException(e); } } GitterService(final GithubRawClient githubRawClient, final String branch, final String path, final ObjectMapper objectMapper); @Cacheable("gitter_fund_notification_rooms") List<String> listFundedNotificationRooms(); }
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); return gitterRooms.getFundedNotification(); } catch (IOException e) { throw new RuntimeException(e); } } GitterService(final GithubRawClient githubRawClient, final String branch, final String path, final ObjectMapper objectMapper); @Cacheable("gitter_fund_notification_rooms") List<String> listFundedNotificationRooms();  }