From d1a760f8d7b51d125675f09b8ed3ce9f758335b7 Mon Sep 17 00:00:00 2001 From: "S. Matthew English" Date: Tue, 14 May 2019 16:43:44 -0400 Subject: [PATCH] ~ --- .../acceptance/dsl/AcceptanceTestBase.java | 1 - ...NetServicesReturnsAllServicesAsActive.java | 5 +- .../acceptance/dsl/jsonrpc/NetServices.java | 48 ------------------- .../dsl/node/factory/PantheonNodeFactory.java | 6 ++- 4 files changed, 7 insertions(+), 53 deletions(-) delete mode 100644 acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/jsonrpc/NetServices.java diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/AcceptanceTestBase.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/AcceptanceTestBase.java index 3fea905eed..9a275da772 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/AcceptanceTestBase.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/AcceptanceTestBase.java @@ -21,7 +21,6 @@ import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Ibft; import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Login; import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Net; -import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.NetServices; import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Perm; import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Web3; import tech.pegasys.pantheon.tests.acceptance.dsl.node.cluster.Cluster; diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java index 8de825ccf9..bf7ab10650 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java @@ -14,16 +14,15 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.google.common.net.InetAddresses; import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition; import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.net.NetServicesTransaction; import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.net.NetTransactions; import tech.pegasys.pantheon.util.NetworkUtility; -import tech.pegasys.pantheon.util.enode.EnodeURL; import java.util.Map; -import java.util.regex.Pattern; + +import com.google.common.net.InetAddresses; public class ExpectNetServicesReturnsAllServicesAsActive implements Condition { diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/jsonrpc/NetServices.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/jsonrpc/NetServices.java deleted file mode 100644 index 84bfd1d9a5..0000000000 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/jsonrpc/NetServices.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc; - -import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; -import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.JsonRequestFactories; -import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.NetServicesJsonRpcRequestFactory; -import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.Transaction; - -import java.util.Map; - -import org.web3j.protocol.core.Request; - -public class NetServices { - - public Map> addPeer(final Node node) { - - final Map> result = - node.execute( - new Transaction>>() { - @Override - public Map> execute( - final JsonRequestFactories requestFactories) { - NetServicesJsonRpcRequestFactory.NetServicesResponse c = null; - try { - NetServicesJsonRpcRequestFactory s = requestFactories.netServices(); - Request t = - s.netServices(); - c = t.send(); - } catch (final Exception ignored) { - } - return c.getResult(); - } - }); - - return result; - } -} diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java index c1cac9b89e..b3e2b60f40 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java @@ -132,7 +132,11 @@ public PantheonNode createArchiveNodeWithDiscoveryDisabledAndAdmin(final String public PantheonNode createArchiveNodeNetServicesDisabled(final String name) throws IOException { return create( - new PantheonFactoryConfigurationBuilder().setName(name).setDiscoveryEnabled(false).build()); + new PantheonFactoryConfigurationBuilder() + .setName(name) + .setP2pEnabled(false) + .setDiscoveryEnabled(false) + .build()); } public PantheonNode createArchiveNodeWithAuthentication(final String name)