### Question:
RuleServiceImpl implements RuleService { @Override public List<RuleCategory> getAllRuleCategories() throws PacManException{ return ruleCategoryRepository.findAll(); }  @Override List<Rule> getAllRulesByTargetType(String targetType); @Override List<RuleProjection> getAllRulesByTargetTypeName(String targetType); @Override List<RuleProjection> getAllRulesByTargetTypeAndNotInRuleIdList(final String targetType, final List<String> ruleIdList); @Override List<RuleProjection> getAllRulesByTargetTypeAndRuleIdList(final String targetType, final List<String> ruleIdList); @Override Rule getByRuleId(String ruleId); @Override Page<Rule> getRules(final String searchTerm, final int page, final int size); @Override Collection<String> getAllAlexaKeywords(); @Override Collection<String> getAllRuleIds(); @Override String createRule(final MultipartFile fileToUpload, final CreateUpdateRuleDetails ruleDetails, final String userId); @Override String updateRule(MultipartFile fileToUpload, CreateUpdateRuleDetails updateRuleDetails, String userId); @Override String invokeRule(String ruleId, List<Map<String, Object>> ruleOptionalParams); @Override String enableDisableRule(final String ruleId, final String action, final String userId); @Override Map<String, Object> invokeAllRules(List<String> ruleIds); boolean isRuleIdExits(String ruleId); @Override List<RuleCategory> getAllRuleCategories();  }### Answer:
@Test public void getAllRuleCategoriesTest() throws PacManException { when(ruleCategoryRepository.findAll()).thenReturn(new ArrayList<>()); assertThat(ruleService.getAllRuleCategories(), is(notNullValue())); }