com.smartbear.readyapi.client.TestRecipe Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ready-api-testserver-client Show documentation
Show all versions of ready-api-testserver-client Show documentation
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);
}
}
}