@Before public void setup() { LOGGER.info("Proxy URL: " + proxyURL); Properties props = System.getProperties(); props.put("http.proxyHost", proxyURL); props.put("http.proxyPort", proxyPort); start(); userOne = new TestSubscriber(); userOne.setUserID(user1); userTwo = new TestSubscriber(); userTwo.setUserID(user2); userThree = new TestSubscriber(); userThree.setUserID(user3); }
@Test public void unsubscribeUser2FromAddressBookSubscriptions() { String userID = user2; TestUtils.startNotificationChannel( userTwo, notificationChannelURL, apiVersion, validLongPoll, applicationUsername, applicationPassword); TestUtils.subscribeToAddressBookNotifications( userTwo, addressBookSubscriptionURL, addressBookRequestData, apiVersion, applicationUsername, applicationPassword); String test = "Unsubscribe User 1 from Address Book Subscriptions"; startTest(test); String url = userTwo.getAddressSubscriptionUrl(); url = prepare(url); RestAssured.authentication = RestAssured.basic(userID, applicationPassword); Response response = RestAssured.given() .auth() .preemptive() .basic(applicationUsername, applicationPassword) .expect() .log() .ifError() .statusCode(204) .delete(url); LOGGER.info("Received Response: " + response.getStatusCode()); endTest(test); }