is there a way to create the REST resources dynamically through groovy script,I am using the below
is there a way to create the REST resources dynamically through groovy script,I am using the below code but the resources are not getting created,any pointers?
import com.eviware.soapui.impl.wsdl.teststeps.registry.RestRequestStepFactory
import com.eviware.soapui.impl.rest.RestMethod
import com.eviware.soapui.impl.rest.RestResource
import com.eviware.soapui.impl.rest.RestService
import com.eviware.soapui.config.RestMethodConfig.Factory
import com.eviware.soapui.config.RestResourceConfig
import com.eviware.soapui.config.RestServiceConfig
RestRequestStepFactory rest = new RestRequestStepFactory();
def project = testRunner.testCase.testSuite.project;
def restServiceConfig = RestServiceConfig.Factory.newInstance();
RestRequestStepFactory restStep = new RestRequestStepFactory()
restServiceConfig.setType("restrequest");
RestService restService = new RestService(project, restServiceConfig);
restService.setName("GoogleService");
RestResource restResource = restService.addNewResource("GoogleService", "/maps/api/distancematrix/json");
RestMethod restMethod = restResource.addNewMethod("POST");
rest.buildTestStep(testRunner.testCase, rest.createNewTestStep(restMethod, "test"), false)