コード例 #1
0
 @Test
 public void testViewExternalIdentifiersHtml() {
   when(mockServiceDelegator.findExternalIdentifiersFromPublicCache(any(String.class)))
       .thenReturn(successResponse);
   Response response = t1OrcidApiService.viewExternalIdentifiersHtml("orcid");
   assertEquals(200, response.getStatus());
 }
コード例 #2
0
 @Before
 public void subvertDelegator() {
   mockServiceDelegator = mock(OrcidApiServiceDelegator.class);
   // view status is always fine
   when(mockServiceDelegator.viewStatusText()).thenReturn(successResponse);
   t1OrcidApiService.setOrcidApiServiceDelegator(mockServiceDelegator);
 }
コード例 #3
0
 @Test
 public void testViewBioDetailsJson() {
   when(mockServiceDelegator.findBioDetailsFromPublicCache(any(String.class)))
       .thenReturn(successResponse);
   Response response = t1OrcidApiService.viewBioDetailsJson("orcid");
   assertEquals(200, response.getStatus());
 }
コード例 #4
0
 @Test
 public void testSearchByQueryXML() {
   UriInfo uriInfo = mock(UriInfo.class);
   t1OrcidApiService.setUriInfo(uriInfo);
   MultivaluedMap<String, String> queryMaps = queryParams();
   when(uriInfo.getQueryParameters()).thenReturn(queryMaps);
   when(mockServiceDelegator.publicSearchByQuery(queryMaps)).thenReturn(successResponse);
   Response response = t1OrcidApiService.searchByQueryXML("orcid");
   assertEquals(200, response.getStatus());
 }