<?xml version="1.0" encoding="UTF-8"?>
<con:testCase id="faaef240-34cd-4936-8809-dab6035ba4f5" discardOkResults="false" failOnError="true" failTestCaseOnErrors="true" keepSession="false" name="QueryHost" searchProperties="true" timeout="0" xmlns:con="http://eviware.com/soapui/config">
  <con:settings>
    <con:setting id="faaef240-34cd-4936-8809-dab6035ba4f5fileName">QueryHost</con:setting>
  </con:settings>
  <con:testStep type="restrequest" name="login" id="b7638ebb-57ce-4136-a5ca-5680cea4d1fa">
    <con:settings/>
    <con:config service="TiEM UI API" resourcePath="/api/v1/user/login" methodName="POST" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <con:restRequest name="login" id="1462dff4-0950-4f59-a435-496c868230e2" mediaType="application/json" postQueryString="false">
        <con:settings>
          <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting>
        </con:settings>
        <con:endpoint>http://172.16.4.134:4100</con:endpoint>
        <con:request>{
  "userName" : "admin",
  "userPassword" : "admin"
}</con:request>
        <con:originalUri>http://172.16.4.134/api/v1/user/login</con:originalUri>
        <con:assertion type="Valid HTTP Status Codes" id="5695fb3a-76ed-4904-bcfb-f0a220d4f2b3" name="Valid HTTP Status Codes">
          <con:settings/>
          <con:configuration>
            <codes>200</codes>
          </con:configuration>
        </con:assertion>
        <con:credentials>
          <con:selectedAuthProfile>No Authorization</con:selectedAuthProfile>
          <con:authType>No Authorization</con:authType>
        </con:credentials>
        <con:jmsConfig JMSDeliveryMode="PERSISTENT"/>
        <con:parameters/>
        <con:environmentSpec>
          <con:entry environmentId="145614f2-3764-4b2c-aea1-428a3da9b4e7">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
          <con:entry environmentId="0348fa2a-7106-45b2-8fa8-793ec5904838">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
        </con:environmentSpec>
      </con:restRequest>
    </con:config>
  </con:testStep>
  <con:testStep type="restrequest" name="QueryHostsByArch" id="7bb389c1-2572-4f52-8200-fc82d0e9b2b1">
    <con:settings/>
    <con:config service="TiEM UI API" resourcePath="/api/v1/resources/hosts" methodName="GET" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <con:restRequest name="QueryHostsByArch" id="e4fa04bd-b5e9-45ab-8870-b86c8f424185" mediaType="application/json">
        <con:settings>
          <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;entry key="Authorization" value="Bearer ${login#Response#$['data']['token']}" xmlns="http://eviware.com/soapui/config"/></con:setting>
        </con:settings>
        <con:endpoint>http://172.16.4.134:4100</con:endpoint>
        <con:request/>
        <con:originalUri>http://172.16.4.134/api/v1/resources/hosts</con:originalUri>
        <con:assertion type="Valid HTTP Status Codes" id="e1ab8536-acd4-4221-9834-7cd8ee2960fd" name="Valid HTTP Status Codes">
          <con:settings/>
          <con:configuration>
            <codes>200</codes>
          </con:configuration>
        </con:assertion>
        <con:assertion type="JsonPath Count" id="8f42dc2c-f0fb-45c6-8327-a05a9a14a182" name="Check count of [hosts]">
          <con:configuration>
            <path>$['data']['hosts']</path>
            <content>14</content>
            <allowWildcards>false</allowWildcards>
            <ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
            <ignoreComments>false</ignoreComments>
          </con:configuration>
        </con:assertion>
        <con:credentials>
          <con:selectedAuthProfile>No Authorization</con:selectedAuthProfile>
          <con:authType>No Authorization</con:authType>
        </con:credentials>
        <con:jmsConfig JMSDeliveryMode="PERSISTENT"/>
        <con:parameters>
          <con:entry key="rack" value=""/>
          <con:entry key="hostIp" value=""/>
          <con:entry key="purpose" value=""/>
          <con:entry key="zone" value=""/>
          <con:entry key="hostId" value=""/>
          <con:entry key="pageSize" value=""/>
          <con:entry key="arch" value="X86_64"/>
          <con:entry key="loadStat" value=""/>
          <con:entry key="page" value=""/>
          <con:entry key="region" value=""/>
          <con:entry key="status" value=""/>
        </con:parameters>
        <con:parameterOrder>
          <con:entry>arch</con:entry>
          <con:entry>hostId</con:entry>
          <con:entry>loadStat</con:entry>
          <con:entry>page</con:entry>
          <con:entry>pageSize</con:entry>
          <con:entry>purpose</con:entry>
          <con:entry>status</con:entry>
          <con:entry>hostIp</con:entry>
          <con:entry>rack</con:entry>
          <con:entry>region</con:entry>
          <con:entry>zone</con:entry>
        </con:parameterOrder>
        <con:environmentSpec>
          <con:entry environmentId="145614f2-3764-4b2c-aea1-428a3da9b4e7">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
          <con:entry environmentId="0348fa2a-7106-45b2-8fa8-793ec5904838">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
        </con:environmentSpec>
      </con:restRequest>
    </con:config>
  </con:testStep>
  <con:testStep type="restrequest" name="QueryHostsByID" id="37487228-a3e7-4587-9ced-e867a302096c">
    <con:settings/>
    <con:config service="TiEM UI API" resourcePath="/api/v1/resources/hosts" methodName="GET" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <con:restRequest name="QueryHostsByID" id="e4fa04bd-b5e9-45ab-8870-b86c8f424185" mediaType="application/json">
        <con:settings>
          <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;entry key="Authorization" value="Bearer ${login#Response#$['data']['token']}" xmlns="http://eviware.com/soapui/config"/></con:setting>
        </con:settings>
        <con:endpoint>http://172.16.4.134:4100</con:endpoint>
        <con:request/>
        <con:originalUri>http://172.16.4.134/api/v1/resources/hosts</con:originalUri>
        <con:assertion type="Valid HTTP Status Codes" id="e1ab8536-acd4-4221-9834-7cd8ee2960fd" name="Valid HTTP Status Codes">
          <con:settings/>
          <con:configuration>
            <codes>200</codes>
          </con:configuration>
        </con:assertion>
        <con:assertion type="JsonPath Count" id="944029cd-2d8d-49aa-8570-ac27a3ad04e0" name="JSONPath Count">
          <con:configuration>
            <path>$['data']['hosts']</path>
            <content>1</content>
            <allowWildcards>false</allowWildcards>
            <ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
            <ignoreComments>false</ignoreComments>
          </con:configuration>
        </con:assertion>
        <con:credentials>
          <con:selectedAuthProfile>No Authorization</con:selectedAuthProfile>
          <con:authType>No Authorization</con:authType>
        </con:credentials>
        <con:jmsConfig JMSDeliveryMode="PERSISTENT"/>
        <con:parameters>
          <con:entry key="rack" value=""/>
          <con:entry key="hostIp" value=""/>
          <con:entry key="purpose" value=""/>
          <con:entry key="zone" value=""/>
          <con:entry key="hostId" value="${QueryHostsByArch#Response#$['data']['hosts'][0]['hostId']}"/>
          <con:entry key="pageSize" value=""/>
          <con:entry key="arch" value=""/>
          <con:entry key="loadStat" value=""/>
          <con:entry key="page" value=""/>
          <con:entry key="region" value=""/>
          <con:entry key="status" value=""/>
        </con:parameters>
        <con:parameterOrder>
          <con:entry>arch</con:entry>
          <con:entry>hostId</con:entry>
          <con:entry>loadStat</con:entry>
          <con:entry>page</con:entry>
          <con:entry>pageSize</con:entry>
          <con:entry>purpose</con:entry>
          <con:entry>status</con:entry>
          <con:entry>hostIp</con:entry>
          <con:entry>rack</con:entry>
          <con:entry>region</con:entry>
          <con:entry>zone</con:entry>
        </con:parameterOrder>
        <con:environmentSpec>
          <con:entry environmentId="145614f2-3764-4b2c-aea1-428a3da9b4e7">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
          <con:entry environmentId="0348fa2a-7106-45b2-8fa8-793ec5904838">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
        </con:environmentSpec>
      </con:restRequest>
    </con:config>
  </con:testStep>
  <con:testStep type="restrequest" name="logout" id="2c100833-9194-4b5d-b7cf-c4c45c3c2255">
    <con:settings/>
    <con:config service="TiEM UI API" resourcePath="/api/v1/user/logout" methodName="POST" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <con:restRequest name="logout" id="46b09598-0eaf-485d-aabe-472863647844" mediaType="application/json" postQueryString="false">
        <con:settings>
          <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;entry key="Authorization" value="Bearer ${login#Response#$['data']['token']}" xmlns="http://eviware.com/soapui/config"/></con:setting>
        </con:settings>
        <con:endpoint>http://172.16.4.134:4100</con:endpoint>
        <con:request/>
        <con:originalUri>http://172.16.4.134/api/v1/user/logout</con:originalUri>
        <con:assertion type="Valid HTTP Status Codes" id="94494498-3063-4a1b-9c8a-d8a302ffd330" name="Valid HTTP Status Codes">
          <con:settings/>
          <con:configuration>
            <codes>200</codes>
          </con:configuration>
        </con:assertion>
        <con:credentials>
          <con:selectedAuthProfile>No Authorization</con:selectedAuthProfile>
          <con:authType>No Authorization</con:authType>
        </con:credentials>
        <con:jmsConfig JMSDeliveryMode="PERSISTENT"/>
        <con:parameters/>
        <con:environmentSpec>
          <con:entry environmentId="145614f2-3764-4b2c-aea1-428a3da9b4e7">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
          <con:entry environmentId="0348fa2a-7106-45b2-8fa8-793ec5904838">
            <con:authProfile>Inherit From Parent</con:authProfile>
          </con:entry>
        </con:environmentSpec>
      </con:restRequest>
    </con:config>
  </con:testStep>
  <con:properties/>
  <con:reportParameters/>
</con:testCase>
