### Question:
CertificateService { public List<Map<String, Object>> getCerticatesDetails(String assetGroup, String searchText, Map<String, String> filter) throws ServiceException { try { return certificateRepository.getCertificatesDetails(assetGroup, searchText, filter); } catch (DataException e) { throw new ServiceException(e); } }  Map<String, Object> getCerticatesExpiryByApplication(
            String assetGroup); List<Map<String, Object>> getCerticatesDetails(String assetGroup,
            String searchText, Map<String, String> filter); Map<String, Object> getCerticatesSummary(String assetGroup);  }### Answer:
@Test public void getCerticatesDetailsTest() throws Exception { when(certificateRepository.getCertificatesDetails(anyString(), anyString(), anyObject())).thenReturn(new ArrayList<>()); assertThat(certificateService.getCerticatesDetails("ag","",new HashMap<>()), is(notNullValue())); }
@Test public void getCerticatesDetailsTest_Exception() throws Exception { when(certificateRepository.getCertificatesDetails(anyString(), anyString(), anyObject())).thenThrow(new DataException()); assertThatThrownBy(() -> certificateService.getCerticatesDetails("ag","",new HashMap<>())) .isInstanceOf(ServiceException.class); }