All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartbear.readyapi.client.TestRecipe Maven / Gradle / Ivy

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

The newest version!
package com.smartbear.readyapi.client;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.smartbear.readyapi.client.execution.ApiException;
import com.smartbear.readyapi.client.model.TestCase;

public class TestRecipe {
    private final TestCase testCase;

    public TestRecipe(TestCase testCase) {
        this.testCase = testCase;
    }

    public TestCase getTestCase() {
        return testCase;
    }

    @Override
    public String toString() {
        try {
            ObjectMapper objectMapper = new ObjectMapper();

            objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
            objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
            return objectMapper.writeValueAsString(testCase);
        } catch (JsonProcessingException e) {
            throw new ApiException(e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy