Fixing intermittent NPE in mobile QSG

application-manager-new
sinthuja 8 years ago
parent c04b8e7872
commit a8b4699cb9

@ -46,6 +46,7 @@ public class MobileQSGTestCase extends TestBase {
super.init(TestUserMode.SUPER_TENANT_ADMIN); super.init(TestUserMode.SUPER_TENANT_ADMIN);
username1 = "alex"; username1 = "alex";
username2 = "chris"; username2 = "chris";
this.client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
} }
@Test(description = "This test case tests the execution of QSG script, whether it executes without any exceptions") @Test(description = "This test case tests the execution of QSG script, whether it executes without any exceptions")
@ -57,7 +58,6 @@ public class MobileQSGTestCase extends TestBase {
Runtime.getRuntime().exec(cmdArray, null, scriptFile); Runtime.getRuntime().exec(cmdArray, null, scriptFile);
// Allow some time to finish its execution // Allow some time to finish its execution
Thread.sleep(10000); Thread.sleep(10000);
this.client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
} }
@Test(description = "This test case tests whether user and roles are created as expected", dependsOnMethods = @Test(description = "This test case tests whether user and roles are created as expected", dependsOnMethods =
@ -104,9 +104,11 @@ public class MobileQSGTestCase extends TestBase {
@AfterClass(alwaysRun = true) @AfterClass(alwaysRun = true)
public void tearDown() throws Exception { public void tearDown() throws Exception {
if (client != null) {
String url = Constants.UserManagement.USER_ENDPOINT + "/" + username1; String url = Constants.UserManagement.USER_ENDPOINT + "/" + username1;
client.delete(url); client.delete(url);
url = Constants.UserManagement.USER_ENDPOINT + "/" + username2; url = Constants.UserManagement.USER_ENDPOINT + "/" + username2;
client.delete(url); client.delete(url);
} }
} }
}

Loading…
Cancel
Save