### Question:
GlossaryService extends GlossaryViewOMAS { public GlossaryViewEntityDetailResponse getGlossary(String userId, String serverName, String glossaryGUID){ return getEntityDetailResponse(userId, serverName, glossaryGUID, GLOSSARY_TYPE_NAME, "getGlossary"); } GlossaryService(); GlossaryViewEntityDetailResponse getGlossary(String userId, String serverName, String glossaryGUID); GlossaryViewEntityDetailResponse getAllGlossaries(String userId, String serverName, Integer from, Integer size); GlossaryViewEntityDetailResponse getTermHomeGlossary(String userId, String serverName, String termGUID); GlossaryViewEntityDetailResponse getCategoryHomeGlossary(String userId, String serverName, String categoryGUID); GlossaryViewEntityDetailResponse getExternalGlossaryLinks(String userId, String serverName, String glossaryGUID,
                                                                     Integer from, Integer size);  }### Answer:
@Test public void getGlossary() throws Exception{ when(repositoryHandler.getEntityByGUID(eq(USER_ID), eq(glossaries.get(0).getGUID()), eq("guid"), eq(GLOSSARY_TYPE_NAME), eq("getGlossary"))).thenReturn(glossaries.get(0)); GlossaryViewEntityDetailResponse response = underTest.getGlossary(USER_ID, SERVER_NAME, glossaries.get(0).getGUID()); assertEquals(1, response.getResult().size()); assertGlossaryProperties(glossaries.get(0), (Glossary)response.getResult().get(0)); }
@Test public void throwOmrsExceptionOnGetEntityByGUID() throws Exception{ PropertyServerException exception = new PropertyServerException(501, "className-getEntityByGUID", "actionDescription-getEntityByGUID", "errorMessage-getEntityByGUID", "systemAction-getEntityByGUID", "userAction-getEntityByGUID"); when(repositoryHandler.getEntityByGUID(eq(USER_ID), eq(glossaries.get(0).getGUID()), eq("guid"), eq(GLOSSARY_TYPE_NAME), eq("getGlossary"))).thenThrow(exception); GlossaryViewEntityDetailResponse response = underTest.getGlossary(USER_ID, SERVER_NAME, glossaries.get(0).getGUID()); assertExceptionDataInResponse(exception, response); }