### Question:
RunDao extends Dao { public List<Run> getList( String commitId, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "testName", testName.toLowerCase() ) ) .must( termQuery( "commitId", commitId.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute().actionGet(); return toList( response ); } @Inject  RunDao( IElasticSearchClient elasticSearchClient ); boolean save( Run run ); boolean delete( Run run ); Run get( String runId ); Map<String, Run> getMap( String commitId, int runNumber, String testName ); Map<String, Run> getMap( String commitId, int runNumber, String testName, Collection<Runner> runners ); List<Run> getAll(); List<Run> getList( String commitId, String testName ); List<Run> getList( String commitId, int runNumber ); List<Run> getList( List<Commit> commits, String testName ); List<Run> getRuns( String runner, String commitId ); Collection<Run> getRuns( String commitId ); Set<String> getTestNames( List<Commit> commits ); int getNextRunNumber( String commitId ); static final String DAO_INDEX_KEY; static final String DAO_TYPE_KEY; }### Answer:
@Test public void getListByCommitsAndTestName() { LOG.info( "\n===RunDaoTest.getListByCommitsAndTestName===\n" ); List<Commit> commits = ESSuiteTest.commitDao.getByModule( ESSuiteTest.MODULE_ID_2 ); List<Run> list = ESSuiteTest.runDao.getList( commits, ESSuiteTest.TEST_NAME_1 ); assertEquals( 2, list.size() ); for ( Run run : list ) { LOG.info( run.toString() ); assertTrue( run.getId().equals( ESSuiteTest.RUN_ID_1 ) || run.getId().equals( ESSuiteTest.RUN_ID_2 ) ); } }
@Test public void getListByCommitAndTestName() { LOG.info( "\n===RunDaoTest.getListByCommitAndTestName===\n" ); List<Run> list = ESSuiteTest.runDao.getList( ESSuiteTest.COMMIT_ID_2, ESSuiteTest.TEST_NAME_1 ); assertEquals( 2, list.size() ); for ( Run run : list ) { LOG.info( run.toString() ); assertTrue( run.getId().equals( ESSuiteTest.RUN_ID_1 ) || run.getId().equals( ESSuiteTest.RUN_ID_2 ) ); } }
@Test public void getListByCommitAndRunNumber() { LOG.info( "\n===RunDaoTest.getListByCommitAndRunNumber===\n" ); int runNumber = 1; List<Run> list = ESSuiteTest.runDao.getList( ESSuiteTest.COMMIT_ID_2, runNumber ); assertEquals( 2, list.size() ); for ( Run run : list ) { LOG.info( run.toString() ); assertTrue( run.getId().equals( ESSuiteTest.RUN_ID_1 ) || run.getId().equals( ESSuiteTest.RUN_ID_4 ) ); } }