@Test @ExpectedDatabase(value = "../setup-db.xml", assertionMode = DatabaseAssertionMode.NON_STRICT) public void getCategoryShouldFindDefaultOne() { InventoryCategory category = inventoryService.getCategory("default_category"); Assert.assertEquals("default description", category.getCategoryDescription()); }
public InventoryCategory getCategory(String name) { if (name == null) { return null; } return inventoryRepository.findByName(name); }
InventoryService { public InventoryCategory getCategory(String name) { if (name == null) { return null; } return inventoryRepository.findByName(name); } }
InventoryService { public InventoryCategory getCategory(String name) { if (name == null) { return null; } return inventoryRepository.findByName(name); }  }
InventoryService { public InventoryCategory getCategory(String name) { if (name == null) { return null; } return inventoryRepository.findByName(name); }  InventoryCategory getCategory(String name); List<InventoryCategory> getAllCategories(); void addCategory(InventoryCategory category); }
InventoryService { public InventoryCategory getCategory(String name) { if (name == null) { return null; } return inventoryRepository.findByName(name); }  InventoryCategory getCategory(String name); List<InventoryCategory> getAllCategories(); void addCategory(InventoryCategory category);  }