use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method setMediaTypeTest.
/*
* @testName: setMediaTypeTest
*
* @assertion_ids: JAXRS:JAVADOC:912; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
*
* @test_Strategy: Update media type of HTTP entity.
*
* ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
* aborted
*/
@Test
public void setMediaTypeTest() throws Fault {
ResponseBuilder builder = createResponse(ContextOperation.SETMEDIATYPE);
Response fake = builder.build();
addProviders(fake);
setProperty(Property.SEARCH_STRING, MediaType.APPLICATION_FORM_URLENCODED);
invoke();
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getPropertyNamesTest.
/*
* @testName: getPropertyNamesTest
*
* @assertion_ids: JAXRS:JAVADOC:1007; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
*
* @test_Strategy: Returns immutable java.util.Collection collection
* containing the property names available within the context of the current
* request/response exchange context.
*
* ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
* aborted
*/
@Test
public void getPropertyNamesTest() throws Fault {
ResponseBuilder builder = createResponse(ContextOperation.GETPROPERTYNAMES);
Response fake = builder.build();
addProviders(fake);
for (int i = 0; i != 5; i++) setProperty(Property.UNORDERED_SEARCH_STRING, TemplateInterceptorBody.PROPERTY + i);
invoke();
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method setAnnotationsTest.
/*
* @testName: setAnnotationsTest
*
* @assertion_ids: JAXRS:JAVADOC:910; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
*
* @test_Strategy: Update annotations on the formal declaration of the
* artifact that initiated the intercepted entity provider invocation.
*
* ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
* aborted
*/
@Test
public void setAnnotationsTest() throws Fault {
Annotation[] annotations = ReaderInterceptorOne.class.getAnnotations();
ResponseBuilder builder = createResponse(ContextOperation.SETANNOTATIONS);
Response fake = builder.build();
addProviders(fake);
for (Annotation a : annotations) setProperty(Property.UNORDERED_SEARCH_STRING, a.annotationType().getName());
invoke();
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method setAnnotationsNullThrowsNPETest.
/*
* @testName: setAnnotationsNullThrowsNPETest
*
* @assertion_ids: JAXRS:JAVADOC:910; JAXRS:JAVADOC:920;
*
* @test_Strategy: Throws NullPointerException - in case the input parameter
* is null.
*
* ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
* aborted
*/
@Test
public void setAnnotationsNullThrowsNPETest() throws Fault {
ResponseBuilder builder = createResponse(ContextOperation.SETANNOTATIONSNULL);
Response fake = builder.entity(TemplateInterceptorBody.ENTITY).build();
addProviders(fake);
setProperty(Property.SEARCH_STRING, TemplateInterceptorBody.NPE);
invoke();
}
use of jakarta.ws.rs.core.Response.ResponseBuilder in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method setPropertyTest.
/*
* @testName: setPropertyTest
*
* @assertion_ids: JAXRS:JAVADOC:913; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
*
* @test_Strategy: Binds an object to a given property name in the current
* request/response exchange context. If the name specified is already used
* for a property, this method will replace the value of the property with the
* new value.
*
* ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
* aborted
*/
@Test
public void setPropertyTest() throws Fault {
ResponseBuilder builder = createResponse(ContextOperation.SETPROPERTY);
Response fake = builder.build();
addProviders(fake);
setProperty(Property.SEARCH_STRING, TemplateInterceptorBody.ENTITY2);
invoke();
}
Aggregations