use of org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController.NodesAllowlistResult in project besu by hyperledger.
the class NodeLocalConfigPermissioningControllerTest method whenAddNodesInputHasExistingNodeShouldReturnAddErrorExistingEntry.
@Test
public void whenAddNodesInputHasExistingNodeShouldReturnAddErrorExistingEntry() {
controller.addNodes(Arrays.asList(enode1));
NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_EXISTING_ENTRY);
NodesAllowlistResult actualResult = controller.addNodes(Lists.newArrayList(enode1, enode2));
assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result");
}
use of org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController.NodesAllowlistResult in project besu by hyperledger.
the class NodeLocalConfigPermissioningControllerTest method whenAddNodesInputHasDuplicatedNodesShouldReturnDuplicatedEntryError.
@Test
public void whenAddNodesInputHasDuplicatedNodesShouldReturnDuplicatedEntryError() {
NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_DUPLICATED_ENTRY);
NodesAllowlistResult actualResult = controller.addNodes(Arrays.asList(enode1, enode1));
assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result");
}
use of org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController.NodesAllowlistResult in project besu by hyperledger.
the class NodeLocalConfigPermissioningControllerTest method whenRemoveNodesInputHasAbsentNodeShouldReturnRemoveErrorAbsentEntry.
@Test
public void whenRemoveNodesInputHasAbsentNodeShouldReturnRemoveErrorAbsentEntry() {
NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_ABSENT_ENTRY);
NodesAllowlistResult actualResult = controller.removeNodes(Lists.newArrayList(enode1, enode2));
assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result");
}
use of org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController.NodesAllowlistResult in project besu by hyperledger.
the class NodeLocalConfigPermissioningControllerTest method whenRemoveNodesInputHasEmptyListOfNodesShouldReturnErrorEmptyEntry.
@Test
public void whenRemoveNodesInputHasEmptyListOfNodesShouldReturnErrorEmptyEntry() {
NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_EMPTY_ENTRY);
NodesAllowlistResult actualResult = controller.removeNodes(new ArrayList<>());
assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result");
}
use of org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController.NodesAllowlistResult in project besu by hyperledger.
the class NodeLocalConfigPermissioningControllerTest method whenRemovingBootnodeShouldReturnRemoveBootnodeError.
@Test
public void whenRemovingBootnodeShouldReturnRemoveBootnodeError() {
NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_FIXED_NODE_CANNOT_BE_REMOVED);
bootnodesList.add(EnodeURLImpl.fromString(enode1));
controller.addNodes(Lists.newArrayList(enode1, enode2));
NodesAllowlistResult actualResult = controller.removeNodes(Lists.newArrayList(enode1));
assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result");
assertThat(controller.getNodesAllowlist()).containsExactly(enode1, enode2);
}
Aggregations