use of jakarta.ws.rs.core.Link.Builder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method fromUriStringTest.
/*
* @testName: fromUriStringTest
*
* @assertion_ids: JAXRS:JAVADOC:790;
*
* @test_Strategy: Create a new instance initialized from an existing URI.
*/
@Test
public void fromUriStringTest() throws Fault {
URI uri = uri(Request.GET.name());
Builder builder = Link.fromUri(uri.toASCIIString());
Link link = builder.build();
assertContains(link.toString(), url());
assertContains(link.toString(), "resource");
assertContains(link.toString(), "get");
logMsg("Link", link, "has been created from URI", uri.toASCIIString());
}
use of jakarta.ws.rs.core.Link.Builder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getUriBuilderTest.
/*
* @testName: getUriBuilderTest
*
* @assertion_ids: JAXRS:JAVADOC:797;
*
* @test_Strategy: Convenience method that returns a
* jakarta.ws.rs.core.UriBuilder initialized with this link's underlying URI.
*/
@Test
public void getUriBuilderTest() throws Fault {
URI uri = uri("get");
Builder builder = Link.fromUri(uri);
Link link = builder.build();
UriBuilder uriBuilder = link.getUriBuilder();
assertTrue(uriBuilder != null, "#getUriBuilder is null");
URI uriFromLink = uriBuilder.build();
assertTrue(uri.equals(uriFromLink), "#getUri() " + uriFromLink + " differes from original uri " + uri);
logMsg("Original URI", uri, "equals obtained", uriFromLink);
}
use of jakarta.ws.rs.core.Link.Builder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getRelIsEmptyListTest.
/*
* @testName: getRelIsEmptyListTest
*
* @assertion_ids: JAXRS:JAVADOC:793;
*
* @test_Strategy: Returns the value associated with the link "rel" param, or
* null if this param is not specified.
*/
@Test
public void getRelIsEmptyListTest() throws Fault {
Builder builder = Link.fromUri(uri("get"));
Link link = builder.build();
String rel = link.getRel();
assertTrue(rel == null, "#getRel is NOT null");
logMsg("#getRel() returns expected null");
}
use of jakarta.ws.rs.core.Link.Builder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getRelTest.
/*
* @testName: getRelTest
*
* @assertion_ids: JAXRS:JAVADOC:793;
*
* @test_Strategy: Returns the value associated with the link "rel" param, or
* null if this param is not specified.
*/
@Test
public void getRelTest() throws Fault {
Builder builder = Link.fromUri(uri("get"));
builder.rel("RELREL").title("TITLETITLE").type("TYPETYPE").param("NEWPARAM", "NEWPARAMVALUE");
Link link = builder.build();
String rel = link.getRel();
assertTrue(rel.contains("RELREL"), "#getRel did NOT return expected RELREL");
logMsg("#getRel() return expected rel");
}
use of jakarta.ws.rs.core.Link.Builder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method linkFromResource.
// ///////////////////////////////////////////////////////////////////
protected static Link linkFromResource(String method) {
Builder builder = Link.fromMethod(Resource.class, method);
Link link = builder.build();
return link;
}
Aggregations