title: Reading json content from file to do assertion functional testing in SOUP UI using Groovy scripts
body: <p>I am using <a href="http://www.soapui.org/About-SoapUI/what-is-soapui.html" rel="nofollow">SOAP UI</a> to test the <a href="http://www.soapui.org/REST-Testing/getting-started.html" rel="nofollow">RESTful</a> web services. To automate the regression testing, I need to compare the actual response and expected output. I have the actual response to the request parsed into a json object. I have the expected output in a text file with JSON content. </p>
  
  <pre><code>import groovy.json.JsonSlurper 
  def response = messageExchange.response.responseContent
  def slurper = new JsonSlurper()
  def responseAsJsonObject = slurper.parseText response
  
  //? Read json file content and parse it as an json object
  
  assert fileContentAsJsonObject == responseAsJsonObject
  </code></pre>
  
  <p>I need a way to read this JSON content from the text file and parse into a json object in <em>Groovy</em>.</p>