Examples of withHeader()


Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "version");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());

        // when
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "user");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.VERSION.getMediaType());

        // when
        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/BSRL/64");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());

        // when
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.VERSION.getMediaType());

        // when
        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/55/properties/anInt");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());

        // when
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()

    public void runtimeException_isMapped() throws Exception {

        // given
        final RestfulRequest restfulReq = client.createRequest(RestfulHttpMethod.GET, "version");
        final Header<Boolean> header = new Header<Boolean>("X-FAIL", Parser.forBoolean());
        restfulReq.withHeader(header, true);

        // when
        final RestfulResponse<JsonRepresentation> jsonResp = restfulReq.execute();

        // then
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.Request.withHeader()

    protected void pingSingleJob(String location) throws Exception{
        log.info("Start pinging {} ... ", location);
        boolean waiting = true;
        while(waiting){
            Request req = builder.buildOtherRequest(new HttpGet(location));
            req.withHeader("Accept", "application/json");
            log.info("Ping method: {}", req.getRequest().getMethod());
            log.info("Ping location: {}", req.getRequest().getURI());
            req.getRequest().setHeader("Accept","application/json");
            log.info("headers:");
            for(Header h : req.getRequest().getAllHeaders()){
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.Request.withHeader()

     * @throws JSONException if the returned results are not valid JSON
     */
    protected RequestExecutor executeQuery(QueryTestCase test) throws IOException, JSONException {
        Request request = builder.buildPostRequest(endpointPath+test.getServicePath());
        for(Entry<String,String> header : test.getHeaders().entrySet()){
            request.withHeader(header.getKey(), header.getValue());
        }
        request.withContent(test.getContent());
        RequestExecutor re = executor.execute(request);
        assertQueryResults(re, test);
        return re;
View Full Code Here

Examples of org.jrack.RackResponse.withHeader()

            String location = secure ?
                    urlUtilities.buildSecure(path) :
                    urlUtilities.buildStandard(path, defaultPort);

            with(Globals.RACK_RESPONSE, response.withHeader("Location", location));
            throw new RedirectException();
        }
    }

    public void setRedirect(String path, boolean secure) throws RedirectException {
View Full Code Here

Examples of play.test.FakeRequest.withHeader()

          JsonNode node = updatePayloadFieldValue("/adminUserCreatePayload.json", "username", sFakeUser);
          //this MUST not raise an error
          ((ObjectNode) node).put(dao.ATTRIBUTES_VISIBLE_BY_ANONYMOUS_USER,(JsonNode)null);
          // Create user
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withJsonBody(node, getMethod());
          Result result = routeAndCall(request);
         
          assertRoute(result, "routeCreateUser_issue_401", Status.BAD_REQUEST, "One or more profile sections is not a valid JSON object", true);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.