Skip to content

Create and Deploy Virtual Service with RR Pair Zip File

sachinmaske edited this page Oct 20, 2022 · 1 revision

These example describes creating a virtual service annotated at the test method level, using RRPair, VSM/VSI files, Data files, Active Config and Swagger, Wadl, Raml files and urls.

Below annotation defines rules to create virtual service before tests.

@Rule public VirtualServicesRule rules = new VirtualServicesRule();

The scope of this annotation remains till the method executes.

@DevTestVirtualServiceV3(serviceName = "vsV3_RRPairZip", workingFolder = "v3/rrpair", port=24778
@DevTestVirtualServer(deployServiceToVse = "VSE",groupName="V3Test")
public class VirtualServiceV3CreateTest {

    @Rule
    public VirtualServicesRule rules = new VirtualServicesRule();
    String API_PROTOCOL = "http";
    
    @DevTestVirtualServiceV3(
            serviceName = "vsV3_RRPairZip",
            port = "24778",
            workingFolder = "v3/rrpair",
            inputFile2 = "Op8andOp9-RRPairs.zip"
    )
    @Test
    public void vsV3_RRPairZip() {
        ResponseParser op8Response = HttpUtils.GET(HttpUtils.URL_FORMAT, "http", "localhost",
                "24778", "import/test/operation-8");
        ResponseParser op9Response = HttpUtils.GET(HttpUtils.URL_FORMAT, "http", "localhost",
                "24778", "import/test/operation-9");
        assert (op8Response != null);
        assert (op8Response.getValue("$.TCEntry[0].termsType").equals("Operation 8 terms"));
        assert (op9Response != null);
        assert (op9Response.getValue("$.TCEntry[0].termsType").equals("Operation 9 terms"));
    }

}

Getting Started

Code Library

Core Functionality

Version 1.4.0

Annotation DevTestVirtualServiceV3

Version 1.3.2

Acknowledgments

Clone this wiki locally