Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.wellsmith;
- import io.restassured.response.Response;
- import org.testng.Assert;
- import org.testng.annotations.Test;
- import java.io.File;
- public class WellSmithApiCallTest {
- WellSmithApiCall obj = new WellSmithApiCall();
- @Test
- public void testMethodGetAccounts() {
- Response response = obj.getAccounts();
- Assert.assertEquals(200, response.statusCode());
- }
- @Test
- public void testCreatePlaybookApi() {
- String path = "/api/patients";
- File file = new File("/Users/sumesh.adhikari/IdeaProjects/TwitterTest/src/test/resources/playbook.json");
- Response response = obj.getPostResponse(path, file);
- Assert.assertEquals(201, response.getStatusCode());
- String location = response.getHeader("Location");
- String patientId = location.replace(path + "/", "");
- System.out.println(patientId);
- Response getResponse = obj.getGetResponse(location);
- Assert.assertEquals(200, getResponse.getStatusCode());
- }
- @Test
- public void testGetPlaybook(){
- String path = "/api/playbooks/3000098";
- Response response = obj.getGetPlaybook(path);
- Assert.assertEquals(200, response.getStatusCode());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement