This repository was archived by the owner on Oct 9, 2025. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 5
Create and Deploy with RR Pair
        sachinmaske edited this page Oct 20, 2022 
        ·
        1 revision
      
    Add the below virtual service annotation above each test method. This annotation should refer to the Requests/Responses pair folder and define virtual service configuration such as service name, listening port, path, type of protocol
 @DevTestVirtualService(serviceName = "UserServiceTest-EJB3UserControlBean",
	port = 9080, basePath = "/itkoExamples/EJB3UserControlBean",
	rrpairsFolder = "UserServiceTest/getListUser/EJB3UserControlBean",
	requestDataProtocol = {@Protocol(ProtocolType.DPH_XML) })For creating RR pairs from raw-traffic file, there is utility called GenerateRRpairs.java. In the below code snippet, mention the path of the package with your raw-traffic file
   FromRawTrafficTestReferentialGenerator.generateRRPairFromRawFiles((GenerateRRPairs.class.getProtectionDomain().getCodeSource().getLocation().getPath()).replaceAll("%20", " ") + ".."
              + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar
              + "lisabank-demo/src/test/resources/rawtraffic");Below is the example of creating and deploying virtual service using RR pairs.
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = LisaBankClientApplication.class)
@DevTestVirtualServer()
public class ProductTest {
    static final Log logger = LogFactory.getLog(BasicTest.class);
    @Value("${webservice.url.product}")
    private String productServiceUrl;
    @Rule
    public VirtualServicesRule rules = new VirtualServicesRule();
    @Autowired
    private ProductService productService;
    @DevTestVirtualService(serviceName = "getProductByXML",
            basePath = "/",
            port = 9956,
            workingFolder = "template2",
            requestDataProtocol = {
                    @Protocol(ProtocolType.DPH_XML) })
    @Test
    public void getProductByXML() throws JAXBException {
        com.ca.devtest.lisabank.demo.business.Product  product = productService.getProduct(productServiceUrl);
        assertNotNull(product);
        logger.info(product.toString());
    }
}Annotation DevTestVirtualServiceV3
- Create and Deploy a Virtual Service Before a Test
- Create and Deploy a Virtual Service Before Any Test from the Class
- Create and Deploy Multiple Virtual Services Before a Test
- Create Update and Deploy Virtual Service Before a Test
- Create, Update and Deploy Virtual Service Before any Test from the Class
- Create and Deploy Virtual Service with RR Pair
- Create and Deploy Virtual Service with RR Pair Zip File
- Create and Deploy Virtual Service with Swagger File
- Create and Deploy Virtual Service with Swagger Url
- Create and Deploy Virtual Service with RAML File
- Create and Deploy Virtual Service with RAML Url
- Create and Deploy Virtual Service with WADL File
- Create and Deploy Virtual Service with WADL Url
- Create and Deploy Virtual Service with VSM/VSI File
- Create and Deploy Virtual Service and Update Data and Config File
- Create and Deploy Virtual Service with Parameterized VSM File
- Create and Deploy Virtual Service with Parameterized Input File
- Create and Deploy Virtual Service with SSL End-Point
- Create and Deploy a Virtual Service before a Test
- Create and Deploy a Virtual Service before Any Test from the Class
- Create and Deploy Multiple Virtual Services before a Test
- Create and Deploy with VRS
- Create and Deploy with RR Pair
- Create and Deploy with VSM
- Parameterized DevTest Virtual Service Annotation
- Generate RR Pairs Utility