nz.ac.auckland.integration.testing.resource.JsonTestResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soaunit Show documentation
Show all versions of soaunit Show documentation
Orchestrated Testing of SOA Artifacts Using Apache Camel
The newest version!
package nz.ac.auckland.integration.testing.resource;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.net.URL;
/**
* Provides a mechanism for retrieving JSON values from a file/URL/String and also
* validating the response from a target service.
*
* @author David MacDonald
*/
public class JsonTestResource extends StaticTestResource {
public JsonTestResource(String value) {
super(value);
}
public JsonTestResource(File file) {
super(file);
}
public JsonTestResource(URL url) {
super(url);
}
/**
* @param file a reference to the JSON test resource
* @return A JSON string
* @throws Exception
*/
protected String getResource(File file) throws Exception {
return FileUtils.readFileToString(file);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy