@Test public void generateQueryWithNoRelevantFilters() throws Exception { NotificationFilter notificationFilter1 = mock(NotificationFilter.class); when(notificationFilter1.filterExpression(any(DocumentReference.class), any(Collection.class), any(NotificationPreference.class))).thenReturn(new EmptyNode()); when(notificationFilter1.matchesPreference(any(NotificationPreference.class))).thenReturn(true); NotificationParameters parameters = new NotificationParameters(); parameters.user = USER_REFERENCE; parameters.format = NotificationFormat.ALERT; parameters.fromDate = startDate; parameters.blackList = Arrays.asList("event1", "event2"); parameters.filters = Collections.singleton(notificationFilter1); parameters.preferences = Arrays.asList(pref1); parameters.filterPreferences = Arrays.asList(fakeFilterPreference); ExpressionNode node = this.queryGenerator.generateQueryExpression(parameters); assertEquals("(((DATE >= \"" + this.startDate.toString() + "\" " + "AND (TYPE = \"create\" AND DATE >= \"" + this.pref1StartDate.toString() + "\")) " + "AND NOT (ID IN (\"event1\", \"event2\"))) " + "AND HIDDEN <> true) " + "ORDER BY DATE DESC", node.toString()); }
public ExpressionNode generateQueryExpression(NotificationParameters parameters) throws EventStreamException { return this.expressionGenerator.generateQueryExpression(parameters); }
QueryGenerator { public ExpressionNode generateQueryExpression(NotificationParameters parameters) throws EventStreamException { return this.expressionGenerator.generateQueryExpression(parameters); } }
QueryGenerator { public ExpressionNode generateQueryExpression(NotificationParameters parameters) throws EventStreamException { return this.expressionGenerator.generateQueryExpression(parameters); }  }
QueryGenerator { public ExpressionNode generateQueryExpression(NotificationParameters parameters) throws EventStreamException { return this.expressionGenerator.generateQueryExpression(parameters); }  Query generateQuery(NotificationParameters parameters); ExpressionNode generateQueryExpression(NotificationParameters parameters); }
QueryGenerator { public ExpressionNode generateQueryExpression(NotificationParameters parameters) throws EventStreamException { return this.expressionGenerator.generateQueryExpression(parameters); }  Query generateQuery(NotificationParameters parameters); ExpressionNode generateQueryExpression(NotificationParameters parameters);  }