ProductHandler { public void deleteProduct(final String name) { final DbProduct dbProduct = getProduct(name); repositoryHandler.deleteProduct(dbProduct.getName()); } ProductHandler(final RepositoryHandler repositoryHandler); void create(final DbProduct dbProduct); void update(final DbProduct dbProduct); List<String> getProductNames(); DbProduct getProduct(final String name); void deleteProduct(final String name); void setProductModules(final String name, final List<String> moduleNames);  }
@Test public void deleteAProductThatDoesNotExist(){ final RepositoryHandler repositoryHandler = GrapesTestUtils.getRepoHandlerMock(); final ProductHandler productHandler = new ProductHandler(repositoryHandler); Exception exception = null; try { productHandler.deleteProduct("doesNotExist"); } catch(Exception e){ exception = e; } assertNotNull(exception); }