-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added user prefix for creating resources, added protection to remove …
…all created resources during tests
- Loading branch information
Showing
5 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ public static void removeConnections(UsersItem.UserName userName) { | |
try { | ||
deleteConnection(uuid); | ||
} catch (ApiException e) { | ||
throw new RuntimeException(e); | ||
} | ||
}); | ||
} | ||
|
@@ -212,7 +211,7 @@ public static Connection createConnectionFCR2ToPort() throws ApiException { | |
|
||
public static ConnectionPostRequest getDefaultConnectionRequest(String name) { | ||
return new ConnectionPostRequest() | ||
.name(name) | ||
.name(name + getCurrentUser().getValue()) | ||
.notifications(singletonList(new SimplifiedNotification() | ||
.type(SimplifiedNotification.TypeEnum.ALL) | ||
.emails(singletonList("[email protected]")))); | ||
|
@@ -275,7 +274,7 @@ public static Connection createPort2SpConnection() throws ApiException { | |
@Test | ||
public void updateConnectionByUuid() throws ApiException { | ||
Connection connection = createPort2Port(); | ||
String updatedName = "updated_p2p_connection"; | ||
String updatedName = "updated_p2p_connection" + getCurrentUser().getValue(); | ||
|
||
ConnectionChangeOperation connectionChangeOperation = new ConnectionChangeOperation() | ||
.op(OpEnum.REPLACE.getValue()) | ||
|
@@ -364,7 +363,7 @@ public static boolean waitForConnectionIsInState(String connectionUuid, EquinixS | |
} | ||
} | ||
try { | ||
Thread.sleep(30000); | ||
Thread.sleep(15000); | ||
} catch (InterruptedException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
@@ -378,10 +377,14 @@ public static boolean waitForConnectionIsInState(String connectionUuid, EquinixS | |
|
||
private static void deleteConnection(String uuid) throws ApiException { | ||
for (int i = 0; i < 3; i++) { | ||
connectionsApi.deleteConnectionByUuid(uuid); | ||
boolean isDeleted = waitForConnectionIsInState(uuid, EquinixStatus.DELETED, EquinixStatus.DEPROVISIONED); | ||
if (isDeleted) { | ||
break; | ||
try { | ||
connectionsApi.deleteConnectionByUuid(uuid); | ||
boolean isDeleted = waitForConnectionIsInState(uuid, EquinixStatus.DELETED, EquinixStatus.DEPROVISIONED); | ||
if (isDeleted) { | ||
break; | ||
} | ||
} catch (Exception e) { | ||
System.out.println("Connection has not been removed for " + uuid); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters