Assert.assertEquals(categoryUpdate, loaded.getCategories());
}
@Test
public void testPartialUpdateWithNull() {
Product initial = createProduct(1);
initial.setCategories(Arrays.asList("cat-1"));
repo.save(initial);
Product loaded = repo.findOne(initial.getId());
Assert.assertEquals(1, loaded.getCategories().size());
PartialUpdate update = new PartialUpdate(SearchableProduct.ID_FIELD, initial.getId());
update.setValueOfField(SearchableProduct.POPULARITY_FIELD, 500);
update.setValueOfField(SearchableProduct.CATEGORY_FIELD, Arrays.asList("cat-1", "cat-2", "cat-3"));
update.setValueOfField(SearchableProduct.NAME_FIELD, null);
solrOperations.saveBean(update);
solrOperations.commit();
loaded = repo.findOne(initial.getId());
Assert.assertEquals(Integer.valueOf(500), loaded.getPopularity());
Assert.assertEquals(3, loaded.getCategories().size());
Assert.assertNull(loaded.getName());
}