This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7497c4
commit 72e6872
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
.../tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesValidPort.java
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.net; | ||
|
||
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.NetVersionTransaction; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class ExpectNetServicesValidPort implements Condition { | ||
|
||
private final NetServicesTransaction transaction; | ||
|
||
public ExpectNetServicesValidPort(final NetServicesTransaction transaction) { | ||
this.transaction = transaction; | ||
} | ||
|
||
@Override | ||
public void verify(Node node) { | ||
|
||
final Boolean result = node.execute(); | ||
|
||
assertThat(result).isTrue(); | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
...va/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/net/NetServicesTransaction.java
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package tech.pegasys.pantheon.tests.acceptance.dsl.transaction.net; | ||
|
||
import org.web3j.protocol.core.Request; | ||
import org.web3j.protocol.core.methods.response.NetVersion; | ||
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; | ||
|
||
public class NetServicesTransaction implements Transaction<Map<String, Map<String, String>>> { | ||
|
||
NetServicesTransaction() {} | ||
|
||
@Override | ||
public Map<String, Map<String, String>> execute( | ||
final JsonRequestFactories requestFactories) { | ||
NetServicesJsonRpcRequestFactory.NetServicesResponse netServicesResponse = null; | ||
try { | ||
NetServicesJsonRpcRequestFactory netServicesJsonRpcRequestFactory = requestFactories.netServices(); | ||
Request<?, NetServicesJsonRpcRequestFactory.NetServicesResponse> request = | ||
netServicesJsonRpcRequestFactory.netServices(); | ||
netServicesResponse = request.send(); | ||
} catch (final Exception ignored) { | ||
} | ||
return netServicesResponse.getResult(); | ||
} | ||
} |
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