use of com.sun.jersey.spi.container.ContainerRequest in project ORCID-Source by ORCID.
the class APIEndpointParserTest method testAPIEndpointParserWithoutApiVersionWithOrcid.
@Test
public void testAPIEndpointParserWithoutApiVersionWithOrcid() {
ContainerRequest request = getRequest("https://localhost:8443/orcid-api-web/1234-4321-1234-4321/orcid-bio");
APIEndpointParser parser = new APIEndpointParser(request);
assertNotNull(parser.getApiVersion());
assertEquals("", parser.getApiVersion());
assertEquals("orcid-bio", parser.getCategory());
assertEquals("1234-4321-1234-4321", parser.getOrcidId());
}
use of com.sun.jersey.spi.container.ContainerRequest in project ORCID-Source by ORCID.
the class APIEndpointParserTest method testAPIEndpointParserWithoutApiVersionOrOrcid.
@Test
public void testAPIEndpointParserWithoutApiVersionOrOrcid() {
ContainerRequest request = getRequest("https://localhost:8443/orcid-api-web/oauth/token");
APIEndpointParser parser = new APIEndpointParser(request);
assertNotNull(parser.getApiVersion());
assertEquals("", parser.getApiVersion());
assertEquals("oauth", parser.getCategory());
assertNull(parser.getOrcidId());
}
use of com.sun.jersey.spi.container.ContainerRequest in project ORCID-Source by ORCID.
the class APIEndpointParserTest method testAPIEndpointParserWithApiVersionAndOrcid.
@Test
public void testAPIEndpointParserWithApiVersionAndOrcid() {
ContainerRequest request = getRequest("https://localhost:8443/orcid-api-web/v2.0/1234-4321-1234-4321/works");
APIEndpointParser parser = new APIEndpointParser(request);
assertEquals("v2.0", parser.getApiVersion());
assertEquals("works", parser.getCategory());
assertEquals("1234-4321-1234-4321", parser.getOrcidId());
}
Aggregations