1818import org .junit .BeforeClass ;
1919import org .junit .Test ;
2020import org .junit .runner .RunWith ;
21+ import org .mockito .Matchers ;
2122import org .mockito .Mock ;
2223import org .mockito .Mockito ;
2324import org .mockito .invocation .InvocationOnMock ;
@@ -120,7 +121,7 @@ public void testRunBasic() throws Exception {
120121
121122 gathererController .run ();
122123
123- verify (jdbcTemplate , Mockito .atLeastOnce ()).update (Mockito .anyString ());
124+ verify (jdbcTemplate , Mockito .atLeastOnce ()).update (Mockito .anyString (), Mockito .< Object > any () );
124125
125126 // List<Integer> addedIDs = new ArrayList<Integer>();
126127 //
@@ -148,6 +149,8 @@ public void testRunBasicInvalidParams() throws Exception {
148149 GathererController gathererController = new GathererController (config , mockFactory );
149150
150151 gathererController .run ();
152+
153+ verify (jdbcTemplate , Mockito .never ()).update (Mockito .anyString (), Mockito .<Object >any ());
151154 }
152155
153156 /**
@@ -166,21 +169,21 @@ public void testRunAdvancedOptions() throws Exception {
166169
167170 gathererController .run ();
168171
169- verify (jdbcTemplate , Mockito .atLeastOnce ()).update (Mockito .anyString ());
170-
171- // List<Integer> addedIDs = new ArrayList<Integer>();
172- //
173- // // Test for IDs we know exist
174- // assertTrue(addedIDs.contains(config.getStartId()));
175- // assertTrue(addedIDs.contains(config.getEndId()));
176- // assertTrue(addedIDs.contains(1557362));
177- // assertTrue(addedIDs.contains(1557495));
178- //
179- // // Test that gatherer has not written records that don't exist
180- // assertFalse(addedIDs.contains(1558259));
181- //
182- // // Test that gatherer has not 'overrun'
183- // assertFalse(addedIDs.contains(config.getStartId() - 1));
184- // assertFalse(addedIDs.contains(config.getEndId() + 1));
172+ verify (jdbcTemplate , Mockito .atLeastOnce ()).update (Mockito .anyString (), Mockito .< Object > any () );
173+
174+ // List<Integer> addedIDs = new ArrayList<Integer>();
175+ //
176+ // // Test for IDs we know exist
177+ // assertTrue(addedIDs.contains(config.getStartId()));
178+ // assertTrue(addedIDs.contains(config.getEndId()));
179+ // assertTrue(addedIDs.contains(1557362));
180+ // assertTrue(addedIDs.contains(1557495));
181+ //
182+ // // Test that gatherer has not written records that don't exist
183+ // assertFalse(addedIDs.contains(1558259));
184+ //
185+ // // Test that gatherer has not 'overrun'
186+ // assertFalse(addedIDs.contains(config.getStartId() - 1));
187+ // assertFalse(addedIDs.contains(config.getEndId() + 1));
185188 }
186189}
0 commit comments