Example: TestServer Recipie in Java

Test recipies can be written in Java using our lightweight client libraries from IntelliJ, NetBeans, or Ecllipse.
 

Status Code Check

To validate that the HTTP status code of a simple GET request is 200, you can compose a code-based test recipie as follows:

junit-sample-statuscode.PNG
 

JSON Content Validation

To provide input data to a service and assert that the structured content contains a specific value for a response element, you can simply add the 'addQueryParameter' and 'assertJsonContent' methods. There are many other useful methods to our client library as referenced in our documentation.

junit-sample-jsonassert.PNG

  Back To All Features
Questions? Email us at sales@smartbear.com or call us +1 617-684-2600