-
Notifications
You must be signed in to change notification settings - Fork 130
Acceptance test - refactor JsonRpc to use conditionals #204
Acceptance test - refactor JsonRpc to use conditionals #204
Conversation
…ce-test-refactor-jsonrpc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
} | ||
|
||
@Test | ||
public void shouldSucceedConnectingToNodeWithWsRpcEnabled() { | ||
rpcEnabledNode.verifyWsRpcEnabled(); | ||
rpcEnabledNode.jsonRpcByWebSockets(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe useWebSocketsForJsonRpc
?
public void verify(final Node node) { | ||
final Throwable thrown = catchThrowable(() -> node.execute(transaction)); | ||
assertThat(thrown).isInstanceOf(ClientConnectionException.class); | ||
assertThat(thrown.getMessage()).contains(expectedMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something for the future, but this feels like we could have a ExpectExceptionCondition
that delegates to another condition (or maybe just Runnable
) and then checks the exception thrown.
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eth.EthGetWorkTransaction; | ||
|
||
public class ExpectEthGetWorkHasThreeNotNullValues implements Condition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would this be clearer if it were named SanityCheckEthGetWorkValues
? Just to be explicit that the requirement isn't really just that there's three arbitrary, non-null values but that's the most we can actually verify about this data.
…ce-test-refactor-jsonrpc
PR description
The main goal of this PR was re-writing the JSON-RPC acceptance tests to use the conditionals and through restricting access reduce the opportunity to create non-conditional style AT.
Fixed Issue(s)