Groovy - SoapUI - Update Headers of Request - Cannot create If statement
<p>I am creating a Test Project in SoapUI and need to do the following:  </p>

<ul>
<li>I have a "Token" Test Suite with 1 Test Case that has: 3 steps that generate the Token for 3 different types of User (Viewer, Admin, Editor) and then one Groovy Script Test Step that takes the Token Header and adds it to all the Test Cases of the Suite.</li>
<li>For some tests I want to add extra Headers to the Test Steps, but I don't want to delete the already assigned Token Headers.</li>
</ul>

<p>I had this script created:</p>

<pre class="lang-groovy prettyprint-override"><code>import groovy.json.JsonSlurper;
import com.eviware.soapui.support.types.StringToStringMap;

//Get through all the test steps in the project
testRunner.testCase.testSuite.project.testSuites.each {
    suite -&gt;
        suite.getValue().testCases.each {
            q1 -&gt;
                q1.getValue().testSteps.each {
                    it -&gt;
                        if (it.getValue().config.type.equals("restrequest")) {
                            //Get the headers of the current teststep
                            def headers = it.getValue().getHttpRequest().getRequestHeaders()

                            //Append the new header to the existing list
                            headers.put("Header A", "Value A");
                            headers.put("Header B", "Value B");
                            headers.put("Header C", "Value C");
                            //Set the updated header list 
                            it.getValue().getHttpRequest().setRequestHeaders(headers)
                        }
                }
        }
}
</code></pre>

<p>This script updates the Headers to all the Test Cases that I want, BUT also, adds the Headers to the "Token" Test Suite and breaks it.</p>

<p>I want to add an "IF" Statement that will check: If the Test Suite name does not contain "Token" add the extra headers to it. If it contains "Token" leave it as it is. I have the Token Test Suite first in the Project so when calling it automated (through Bamboo) it generates the Token and thus the headers to the rest of the test cases.</p>

<p>I've tried a couple of things but my Groovy skills are amateur and always result in errors.  Can you suggest a solution?</p>

<p>Thank you for your time. </p>