@Test
public void setProductModules(){

    final DbProduct product = new DbProduct();
    product.setName("product1");
    final RepositoryHandler repositoryHandler = GrapesTestUtils.getRepoHandlerMock();
    when(repositoryHandler.getProduct(product.getName())).thenReturn(product);
    final ProductHandler productHandler = new ProductHandler(repositoryHandler);
    final List<String> moduleNames = Lists.newArrayList("module1", "module2", "module3");
    productHandler.setProductModules(product.getName(), moduleNames);
    final ArgumentCaptor<DbProduct> captor = ArgumentCaptor.forClass(DbProduct.class);
    verify(repositoryHandler, times(1)).store(captor.capture());
    assertEquals(moduleNames, captor.getValue().getModules());
}