@Test public void test_should_throw_exception_when_category_id_is_not_present_for_category_search() { final ServiceTypeSearchCriteria searchCriteria = ServiceTypeSearchCriteria.builder() .complaintTypeSearch("category") .categoryId(null) .build(); thrown.expect(InvalidServiceTypeSearchException.class); thrown.expectMessage("Category id is not present"); searchCriteria.validate(); }
public void validate() { validateSearchType(); validateCategorySearchType(); }
ServiceTypeSearchCriteria { public void validate() { validateSearchType(); validateCategorySearchType(); } }
ServiceTypeSearchCriteria { public void validate() { validateSearchType(); validateCategorySearchType(); }  }
ServiceTypeSearchCriteria { public void validate() { validateSearchType(); validateCategorySearchType(); }  ServiceRequestTypeSearch getComplaintTypeSearch(); int getCount(); void validate(); boolean isCategorySearch(); boolean isFrequencySearch(); boolean isReturnAll(); }
ServiceTypeSearchCriteria { public void validate() { validateSearchType(); validateCategorySearchType(); }  ServiceRequestTypeSearch getComplaintTypeSearch(); int getCount(); void validate(); boolean isCategorySearch(); boolean isFrequencySearch(); boolean isReturnAll();  }