org.sonar.api.server.ws
Class WsTester.Result

java.lang.Object
  extended by org.sonar.api.server.ws.WsTester.Result
Enclosing class:
WsTester

public static class WsTester.Result
extends Object


Method Summary
 WsTester.Result assertJson(Class clazz, String expectedJsonFilename)
          Compares JSON response with JSON file available in classpath.
 WsTester.Result assertJson(String expectedJson)
           
 WsTester.Result assertNoContent()
           
 String outputAsString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertNoContent

public WsTester.Result assertNoContent()

outputAsString

public String outputAsString()

assertJson

public WsTester.Result assertJson(String expectedJson)
                           throws Exception
Throws:
Exception

assertJson

public WsTester.Result assertJson(Class clazz,
                                  String expectedJsonFilename)
                           throws Exception
Compares JSON response with JSON file available in classpath. For example if class is org.foo.BarTest and filename is index.json, then file must be located at src/test/resources/org/foo/BarTest/index.json.

Parameters:
clazz - the test class
jsonResourceFilename - name of the file containing the expected JSON
Throws:
Exception


Copyright © 2009-2014 SonarSource. All Rights Reserved.