Assert.assertEquals(toInsert.getPopularity(), recalled.getPopularity());
}
@Test
public void testPartialUpdateAddMultipleValuesToMultivaluedField() {
ExampleSolrBean toInsert = createDefaultExampleBean();
toInsert.setPopularity(10);
solrTemplate.saveBean(toInsert);
solrTemplate.commit();
PartialUpdate update = new PartialUpdate("id", DEFAULT_BEAN_ID);
update.addValueToField("cat", Arrays.asList("spring", "data", "solr"));
solrTemplate.saveBean(update);
solrTemplate.commit();
Assert.assertEquals(1, solrTemplate.count(ALL_DOCUMENTS_QUERY));
ExampleSolrBean recalled = solrTemplate.queryForObject(DEFAULT_BEAN_OBJECT_QUERY, ExampleSolrBean.class);
Assert.assertEquals(toInsert.getId(), recalled.getId());
Assert.assertEquals(4, recalled.getCategory().size());
Assert.assertEquals(Arrays.asList(toInsert.getCategory().get(0), "spring", "data", "solr"), recalled.getCategory());
Assert.assertEquals(toInsert.getName(), recalled.getName());
Assert.assertEquals(toInsert.getPopularity(), recalled.getPopularity());
}