From aee172131dc89cf8cb2eb83492583539aa9f1827 Mon Sep 17 00:00:00 2001 From: Stian Soiland-Reyes Date: Wed, 22 May 2013 11:26:51 +0100 Subject: [PATCH] RDF: Test for RDF/XML entity --- .../api/t1/server/T1OrcidApiServiceImplRDFTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/orcid-pub-web/src/test/java/org/orcid/api/t1/server/T1OrcidApiServiceImplRDFTest.java b/orcid-pub-web/src/test/java/org/orcid/api/t1/server/T1OrcidApiServiceImplRDFTest.java index 636363c5515..4f975e0a78e 100644 --- a/orcid-pub-web/src/test/java/org/orcid/api/t1/server/T1OrcidApiServiceImplRDFTest.java +++ b/orcid-pub-web/src/test/java/org/orcid/api/t1/server/T1OrcidApiServiceImplRDFTest.java @@ -21,6 +21,7 @@ import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.orcid.api.common.OrcidApiConstants.*; import java.util.Arrays; @@ -64,7 +65,7 @@ public void subvertDelegator() { private Response fakeBio() { OrcidMessage orcidMessage = new OrcidMessage(); OrcidProfile orcidProfile1 = new OrcidProfile(); - orcidProfile1.setOrcid("000-1337"); + orcidProfile1.setOrcid("http://orcid.example.com/000-1337"); orcidProfile1.setOrcidId("000-1337"); OrcidBio bio = new OrcidBio(); orcidProfile1.setOrcidBio(bio); @@ -102,9 +103,15 @@ public void testViewBioDetailsRdf() { assertTrue(T1OrcidApiServiceImpl.T1_SEARCH_REQUESTS.count() == 0); Response response = t1OrcidApiService.viewBioDetailsRdf("orcid"); assertEquals(200, response.getStatus()); - System.out.println(response.getEntity()); +// assertEquals(APPLICATION_RDFXML, response.getMetadata().g) + String str = response.getEntity().toString(); +// System.out.println(str); + assertTrue(str.contains("http://orcid.example.com/000-1337")); + assertTrue(str.contains("foaf:fullname>John")); + assertTrue(str.contains("rdf:about")); assertTrue(T1OrcidApiServiceImpl.T1_GET_REQUESTS.count() == 1); assertTrue(T1OrcidApiServiceImpl.T1_SEARCH_REQUESTS.count() == 0); + } /*