Skip to content

Commit

Permalink
make class testabler
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoniecz committed Mar 11, 2018
1 parent d6e2f61 commit f5894ce
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,23 @@ public AbstractQuestAnswerFragment createForm()
return new YesNoQuestAnswerFragment();
}

static String getQueryPart(String key, String nameOfGeneratedGroup, int reviewIntervalInDays){
String currentDate = DateUtil.getCurrentDateString() + "T00:00:00Z";
String repeatedReviewCutoffDate = DateUtil.getOffsetDateString(-reviewIntervalInDays) + "T00:00:00Z";
private static String getCurrentDateString(){
return DateUtil.getCurrentDateString() + "T00:00:00Z";
}

private static String getOffsetDateString(int offset){
return DateUtil.getOffsetDateString(offset) + "T00:00:00Z";
}

static String getQueryPart(String key, String nameOfGeneratedGroup, int reviewIntervalInDays){
return
"way[" + key + "=construction] -> .under_construction;" +
"(" +
"way[" + key + "=construction][opening_date](" +
" if:is_date(t['opening_date']) && date(t['opening_date'])>date('" + currentDate + "'));" +
" if:is_date(t['opening_date']) && date(t['opening_date'])>date('" + getCurrentDateString() + "'));" +
") -> .known_opening_date_in_future;" +
"(" +
" way[" + key + "=construction](newer:'" + repeatedReviewCutoffDate + "');" +
" way[" + key + "=construction](newer:'" + getOffsetDateString(-reviewIntervalInDays) + "');" +
") -> .recently_edited;" +
"((" +
" .under_construction" +
Expand Down

0 comments on commit f5894ce

Please sign in to comment.