diff --git a/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/ConnectionsApiTest.java b/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/ConnectionsApiTest.java index 7dfdbe5..54fc2b0 100644 --- a/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/ConnectionsApiTest.java +++ b/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/ConnectionsApiTest.java @@ -38,16 +38,16 @@ public class ConnectionsApiTest { public static void removeConnections(UsersItem.UserName userName) { try { Thread.sleep(20000); + users.get(userName).getUserResources().getConnectionsUuid().forEach(uuid -> { + try { + deleteConnection(uuid); + } catch (ApiException e) { + throw new RuntimeException(e); + } + }); } catch (InterruptedException e) { throw new RuntimeException(e); } - users.get(userName).getUserResources().getConnectionsUuid().forEach(uuid -> { - try { - deleteConnection(uuid); - } catch (ApiException e) { - throw new RuntimeException(e); - } - }); } @BeforeClass @@ -177,7 +177,7 @@ public static Connection createConnectionFCR2ToPort() throws ApiException { Port port = portList.get(r.nextInt(portList.size())); - ConnectionPostRequest connectionPostRequest = getDefaultConnectionRequest("panthers-con-fcr-2-port") + ConnectionPostRequest connectionPostRequest = getDefaultConnectionRequest("panthers-con-fc2p") .type(ConnectionType.IP_VC) .bandwidth(1000) .project(new Project().projectId(userDto.getProjectId())) @@ -229,7 +229,7 @@ public static Connection createPort2SpConnection() throws ApiException { UsersItem usersItem = Utils.getUserData(getCurrentUser()); PortDto portDto = usersItem.getPorts().get(0); - ConnectionPostRequest connectionPostRequest = getDefaultConnectionRequest("panthers-con-port-2-sp") + ConnectionPostRequest connectionPostRequest = getDefaultConnectionRequest("panthers-con-p2sp") .bandwidth(serviceProfile.getAccessPointTypeConfigs().get(0).getServiceProfileAccessPointTypeCOLO().getSupportedBandwidths().get(0)) .type(ConnectionType.EVPL_VC) .redundancy(new ConnectionRedundancy().priority(ConnectionPriority.PRIMARY)) @@ -275,6 +275,7 @@ public static Connection createPort2SpConnection() throws ApiException { @Test public void updateConnectionByUuid() throws ApiException { Connection connection = createPort2Port(); + waitForConnectionIsInState(connection.getUuid(), EquinixStatus.PROVISIONED); String updatedName = "updated_p2p_connection"; ConnectionChangeOperation connectionChangeOperation = new ConnectionChangeOperation() @@ -312,7 +313,7 @@ public static Connection createPort2Port() throws ApiException { int tagAside = getRandomVlanNumber(); int tagZside = getRandomVlanNumber(); - ConnectionPostRequest connectionPostRequest = getDefaultConnectionRequest("panthers-con-port-2-port") + ConnectionPostRequest connectionPostRequest = getDefaultConnectionRequest("panthers-con-p2p") .bandwidth(1000) .type(ConnectionType.EVPL_VC) .redundancy(new ConnectionRedundancy().priority(ConnectionPriority.PRIMARY)) diff --git a/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/NetworksApiTest.java b/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/NetworksApiTest.java index f196088..a2d0112 100644 --- a/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/NetworksApiTest.java +++ b/equinix-openapi-fabric-tests/src/test/java/com/equinix/openapi/fabric/tests/NetworksApiTest.java @@ -20,8 +20,7 @@ import java.util.UUID; -import static com.equinix.openapi.fabric.tests.helpers.Apis.networksApi; -import static com.equinix.openapi.fabric.tests.helpers.Apis.setUserName; +import static com.equinix.openapi.fabric.tests.helpers.Apis.*; import static com.equinix.openapi.fabric.tests.helpers.TokenGenerator.users; import static java.util.Collections.singletonList; import static org.junit.Assert.assertEquals; @@ -50,7 +49,7 @@ public static void removeResources() { public Network createNetwork() throws ApiException { UsersItem user = Utils.getUserData(userName); NetworkPostRequest networkPostRequest = new NetworkPostRequest() - .name("network_panthers_test") + .name("panthers_network" + getCurrentUser().getValue()) .type(NetworkType.EVPLAN) .scope(NetworkScope.LOCAL) .project(new Project().projectId(user.getProjectId())) @@ -124,7 +123,7 @@ public void getNetworkByUuid() throws ApiException { */ @Test public void updateNetwork() throws ApiException { - String updatedName = "network_new_updatedName"; + String updatedName = "panthers_network_updated"; Network network = createNetwork(); NetworkChangeOperation changeOperation = new NetworkChangeOperation() .op(NetworkChangeOperation.OpEnum.REPLACE)