@Test
public void testNewGapFull() throws Exception {

    detector.setFullGapAnalysis(true);
    when(contextService.is(ContextConstants.ROUTING_FULL_GAP_ANALYSIS)).thenReturn(true);
    List<Long> dataIds = new ArrayList<Long>();
    dataIds.add(100L);
    String sql = ArgumentMatchers.anyString();
    @SuppressWarnings("unchecked")
    ISqlRowMapper<Long> mapper = (ISqlRowMapper<Long>) ArgumentMatchers.any();
    when(sqlTemplate.query(sql, mapper, ArgumentMatchers.eq(4L), ArgumentMatchers.eq(50000004L))).thenReturn(dataIds);
    
    List<DataGap> dataGaps = new ArrayList<DataGap>();
    dataGaps.add(new DataGap(3, 3));
    dataGaps.add(new DataGap(4, 50000004));
    runGapDetector(dataGaps, new ArrayList<Long>(), true);
    Set<DataGap> deleted = new HashSet<DataGap>();
    deleted.add(new DataGap(4, 50000004));
    Set<DataGap> inserted = new HashSet<DataGap>();
    inserted.add(new DataGap(4, 99));
    inserted.add(new DataGap(101, 50000100));
    verify(dataService).findDataGaps();
    verify(dataService).deleteDataGaps(sqlTransaction, deleted);
    verify(dataService).insertDataGaps(sqlTransaction, inserted);        
    verifyNoMoreInteractions(dataService);
}