From c0a1c7081c861fb336e01f6245d2c2905d0897a3 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Thu, 6 May 2021 16:41:21 +1000 Subject: [PATCH] refactored perm ATs to remove dupe (#2230) * refactored tests to remove dupe Signed-off-by: Sally MacFarlane --- ...rtContractPermissioningAcceptanceTest.java | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java index 3eb746b7ae..7c8c78c4b3 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java @@ -46,6 +46,9 @@ public class NodeSmartContractPermissioningAcceptanceTest permissionedNode.execute(allowNode(permissionedNode)); permissionedNode.verify(nodeIsAllowed(permissionedNode)); + + permissionedNode.verify(admin.addPeer(bootnode)); + permissionedNode.verify(admin.addPeer(allowedNode)); } @Test @@ -58,38 +61,18 @@ public class NodeSmartContractPermissioningAcceptanceTest @Test public void permissionedNodeShouldDisconnectFromNodeNotPermittedAnymore() { - permissionedNode.verify(admin.addPeer(bootnode)); - permissionedNode.verify(admin.addPeer(allowedNode)); - permissionedNode.verify(net.awaitPeerCount(2)); - permissionedNode.execute(forbidNode(allowedNode)); permissionedNode.verify(connectionIsForbidden(permissionedNode, allowedNode)); permissionedNode.verify(net.awaitPeerCount(1)); } - @Test - public void permissionedNodeShouldConnectToNewlyPermittedNode() { - permissionedNode.verify(admin.addPeer(bootnode)); - permissionedNode.verify(admin.addPeer(allowedNode)); - permissionedNode.verify(net.awaitPeerCount(2)); - - permissionedNode.execute(allowNode(forbiddenNode)); - permissionedNode.verify(connectionIsAllowed(permissionedNode, forbiddenNode)); - permissionedNode.verify(admin.addPeer(forbiddenNode)); - - permissionedNode.verify(net.awaitPeerCount(3)); - } - @Test public void permissioningUpdatesPropagateThroughNetwork() { - permissionedNode.verify(admin.addPeer(bootnode)); - permissionedNode.verify(admin.addPeer(allowedNode)); - permissionedNode.verify(net.awaitPeerCount(2)); - - // permissioning changes in peer should propagate to permissioned node + // connection to newly permitted node is allowed allowedNode.execute(allowNode(forbiddenNode)); allowedNode.verify(connectionIsAllowed(permissionedNode, forbiddenNode)); + // permissioning changes in peer should propagate to permissioned node permissionedNode.verify(connectionIsAllowed(permissionedNode, forbiddenNode)); permissionedNode.verify(admin.addPeer(forbiddenNode));