-
Notifications
You must be signed in to change notification settings - Fork 5
Create and Deploy with VRS
sachinmaske edited this page Oct 20, 2022
·
1 revision
This example describes on how to create and deploy virtual service from request/response pairs that uses non-HTTP configured mode i.e. VRS file.
Below annotation should be given before class name. It describes configurations related to Virtual service environment.
@DevTestVirtualServer(registryHost = "localhost",deployServiceToVse = "VSE", login = "admin", password="admin")
Below annotation should be given before test method. It describe configurations of virtual service.
@DevTestVirtualServiceFromVrs(serviceName = "getUserWithVrs", workingFolder = "soapWithVrs", vrsConfig = @Config(value = "transport.vrs", parameters = {
@Parameter(name = "port", value = "9081"),
@Parameter(name = "basePath", value = "/itkoExamples/EJB3UserControlBean") }))
- serviceName = Any name you want to provide for this service
- workingFolder = path of the directory where the RR pair and .vrs file is placed.
- vsrConfig = name of recording session file i.e .vrs file.
Rest of the attributes are optional
Below is the example of creating and deploying virtual service using recorded traffic file.
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = LisaBankClientApplication.class)
@DevTestVirtualServer()
public class UserServiceTest {
static final Log logger = LogFactory.getLog(UserServiceTest.class);
@Autowired
private BankService bankServices;
@Rule
public VirtualServicesRule rules = new VirtualServicesRule();
@DevTestVirtualServiceFromVrs(serviceName = "getUserWithVrs", workingFolder = "soapWithVrs", vrsConfig = @Config(value = "transport.vrs", parameters = {
@Parameter(name = "port", value = "9081"),
@Parameter(name = "basePath", value = "/itkoExamples/EJB3UserControlBean") }))
@Test
public void getUser() {
User[] users = bankServices.getListUser();
assertNotNull(users);
printUsers(users);
assertEquals(1, users.length);
}
private void printUsers(User[] users) {
for (User user : users) {
logger.info(user.getFname() + " " + user.getLname() + " " + user.getLogin());
}
}
}
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