@SuppressWarnings("unchecked")
@Test
public void testSaveBeansCommitWithin() throws IOException, SolrServerException {
Mockito.when(solrServerMock.add(Mockito.anyCollectionOf(SolrInputDocument.class), Mockito.eq(10000))).thenReturn(
new UpdateResponse());
List<SimpleJavaObject> collection = Arrays.asList(new SimpleJavaObject("1", 1l), new SimpleJavaObject("2", 2l),
new SimpleJavaObject("3", 3l));
UpdateResponse updateResponse = solrTemplate.saveBeans(collection, 10000);
Assert.assertNotNull(updateResponse);
@SuppressWarnings("rawtypes")
ArgumentCaptor<List> captor = ArgumentCaptor.forClass(List.class);
Mockito.verify(solrServerMock, Mockito.times(1)).add(captor.capture(), Mockito.eq(10000));