Package de.devbliss.apitester

Examples of de.devbliss.apitester.Context


    private Context doGetRequest(URI uri) throws Exception {
        return apiTest.get(uri);
    }

    protected ApiResponse makeGetRequest(URI uri) throws Exception {
        Context context = doGetRequest(uri);
        sayUri(context.apiRequest);
        docTestMachine.sayResponse(context.apiResponse, showHeaders());
        return context.apiResponse;
    }
View Full Code Here


    protected ApiResponse makePostRequest(URI uri) throws Exception {
        return makePostRequest(uri, null);
    }

    protected ApiResponse makePostRequest(URI uri, Object obj) throws Exception {
        Context context = doPostRequest(uri, obj);
        sayUri(context.apiRequest, obj);
        docTestMachine.sayResponse(context.apiResponse, showHeaders());
        return context.apiResponse;
    }
View Full Code Here

    protected ApiResponse makePostUploadRequest(URI uri, File fileToUpload, String paramName)
            throws Exception {
        FileBody fileBodyToUpload = new FileBody(fileToUpload);
        String mimeType = new MimetypesFileTypeMap().getContentType(fileToUpload);

        Context context =
                apiTest.post(uri, null, new PostUploadWithoutRedirectImpl(paramName,
                        fileBodyToUpload));

        docTestMachine.sayUploadRequest(context.apiRequest, fileBodyToUpload.getFilename(),
                fileHelper.readFile(fileToUpload), fileToUpload.length(), mimeType, showHeaders());
View Full Code Here

    protected ApiResponse makePutRequest(URI uri) throws Exception {
        return makePutRequest(uri, null);
    }

    protected ApiResponse makePutRequest(URI uri, Object obj) throws Exception {
        Context context = doPutRequest(uri, obj);
        sayUri(context.apiRequest, obj);
        docTestMachine.sayResponse(context.apiResponse, showHeaders());
        return context.apiResponse;
    }
View Full Code Here

    protected ApiResponse makeDeleteRequest(URI uri) throws Exception {
        return makeDeleteRequest(uri, null);
    }

    protected ApiResponse makeDeleteRequest(URI uri, Object obj) throws Exception {
        Context context = doDeleteRequest(uri, obj);
        sayUri(context.apiRequest, obj);
        docTestMachine.sayResponse(context.apiResponse, showHeaders());
        return context.apiResponse;
    }
View Full Code Here

    public ApiResponse makeGetRequest(URI uri) throws Exception {
      return makeGetRequest(uri, null);
    }

    public ApiResponse makeGetRequest(URI uri, Map<String, String> additionalHeaders) throws Exception {
        Context context = doGetRequest(uri, additionalHeaders);
        sayRequest(context.apiRequest);
        docTestMachine.sayResponse(context.apiResponse, headersToShow);
        return context.apiResponse;
    }
View Full Code Here

    public ApiResponse makePostRequest(URI uri, Map<String, String> additionalHeaders) throws Exception {
      return makePostRequest(uri, null, additionalHeaders);
  }

    public ApiResponse makePostRequest(URI uri, Object payload, Map<String, String> additionalHeaders) throws Exception {
        Context context = doPostRequest(uri, payload, additionalHeaders);
        sayRequest(context.apiRequest, payload);
        docTestMachine.sayResponse(context.apiResponse, headersToShow);
        return context.apiResponse;
    }
View Full Code Here

    protected ApiResponse makePostUploadRequest(URI uri, File fileToUpload, String paramName, Map<String, String> additionalHeaders)
            throws Exception {
        FileBody fileBodyToUpload = new FileBody(fileToUpload);
        String mimeType = new MimetypesFileTypeMap().getContentType(fileToUpload);

        Context context =
                apiTest.post(uri, null, new PostUploadWithoutRedirectImpl(paramName,
                        fileBodyToUpload), additionalHeaders);

        docTestMachine.sayUploadRequest(context.apiRequest, fileBodyToUpload.getFilename(),
                fileHelper.readFile(fileToUpload), fileToUpload.length(), mimeType, headersToShow,
View Full Code Here

    public ApiResponse makePutRequest(URI uri, Map<String, String> additionalHeaders) throws Exception {
      return makePutRequest(uri, null, additionalHeaders);
    }

    public ApiResponse makePutRequest(URI uri, Object obj, Map<String, String> additionalHeaders) throws Exception {
        Context context = doPutRequest(uri, obj, additionalHeaders);
        sayRequest(context.apiRequest, obj);
        docTestMachine.sayResponse(context.apiResponse, headersToShow);
        return context.apiResponse;
    }
View Full Code Here

    public ApiResponse makePatchRequest(URI uri, Map<String, String> additionalHeaders) throws Exception {
      return makePatchRequest(uri, null, additionalHeaders);
    }

    public ApiResponse makePatchRequest(URI uri, Object obj, Map<String, String> additionalHeaders) throws Exception {
        Context context = doPatchRequest(uri, obj, additionalHeaders);
        sayRequest(context.apiRequest, obj);
        docTestMachine.sayResponse(context.apiResponse, headersToShow);
        return context.apiResponse;
    }
View Full Code Here

TOP

Related Classes of de.devbliss.apitester.Context

Copyright © 2018 www.massapicom. 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.