@Test public void testSelectQueries() { FinishedLensQuery mockFinishedQuery = mock(FinishedLensQuery.class); EstimatedImmutableQueryCollection mockWaitingQueries = mock(EstimatedImmutableQueryCollection.class); String mockUser = "MockUser"; Set expectedQueriesSet = mock(Set.class); when(mockFinishedQuery.getSubmitter()).thenReturn(mockUser); when(mockWaitingQueries.getQueries(mockUser)).thenReturn(expectedQueriesSet); WaitingQueriesSelectionPolicy selectionPolicy = new UserSpecificWaitingQueriesSelectionPolicy(); Set actualEligibleQueries = selectionPolicy.selectQueries(mockFinishedQuery, mockWaitingQueries); assertEquals(actualEligibleQueries, expectedQueriesSet); }
@Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { String user = finishedQuery.getSubmitter(); return waitingQueries.getQueries(user); }
UserSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { String user = finishedQuery.getSubmitter(); return waitingQueries.getQueries(user); } }
UserSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { String user = finishedQuery.getSubmitter(); return waitingQueries.getQueries(user); }  }
UserSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { String user = finishedQuery.getSubmitter(); return waitingQueries.getQueries(user); }  @Override Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery,
      final EstimatedImmutableQueryCollection waitingQueries); }
UserSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { String user = finishedQuery.getSubmitter(); return waitingQueries.getQueries(user); }  @Override Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery,
      final EstimatedImmutableQueryCollection waitingQueries);  }