JiraProjectReader implements ProjectReader { String getUpdateJqlQueryString(LocalDateTime dateTime) { JqlQueryStringBuilder andQueryBuilder = new JqlQueryStringBuilder(); JqlQueryStringBuilder orQueryBuilder = new JqlQueryStringBuilder(); orQueryBuilder .newQuery("updated", JqlComparator.GREATER_OR_EQUAL, dateTime) .or("created", JqlComparator.GREATER_OR_EQUAL, dateTime); return andQueryBuilder .newQuery("issuetype", JqlComparator.EQUAL, "Staffinganfrage") .and("project", JqlComparator.EQUAL, "Staffing") .and(orQueryBuilder.build()) .build(); } JiraProjectReader(RestTemplateBuilder builder, JiraConfigurationProperties properties); @Override List<Project> getAllProjectsSince(LocalDateTime dateTime); @Override List<Project> getInitialProjects(); @Override Health health();  }
@Test public void getUpdateJqlQueryStringReturnsExpectedQuery() { var expectedDateString = "2018-01-01 13:37"; var datePatternString = "yyyy-MM-dd HH:mm"; var dateTime = LocalDateTime.parse(expectedDateString, DateTimeFormatter.ofPattern(datePatternString)); var expectedQueryString = String.format(" issuetype = \"Staffinganfrage\" AND project = \"Staffing\" AND ( updated >= \"%s\" OR created >= \"%s\" )", expectedDateString, expectedDateString); var actualQueryString = jiraProjectReader.getUpdateJqlQueryString(dateTime); assertThat(expectedQueryString).isEqualTo(actualQueryString); }