Skip to content

Commit

Permalink
[MINOR] updating enclave AT code to remove orion references (hyperled…
Browse files Browse the repository at this point in the history
…ger#3143)

* cleanup orion messages

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
  • Loading branch information
macfarla authored Dec 8, 2021
1 parent 43e67e0 commit 62a95ab
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,9 @@ public void enclaveNoPeerUrlError() {
alice.getEnclaveKey(),
wrongPublicKey)));

final String orionMessage = JsonRpcError.NODE_MISSING_PEER_URL.getMessage();
final String tesseraMessage = JsonRpcError.TESSERA_NODE_MISSING_PEER_URL.getMessage();

assertThat(throwable.getMessage())
.has(matchOrionOrTesseraMessage(orionMessage, tesseraMessage));
assertThat(throwable.getMessage()).has(matchTesseraEnclaveMessage(tesseraMessage));
}

@Test
Expand Down Expand Up @@ -197,17 +195,14 @@ public void transactionFailsIfPartyIsOffline() {
public void createPrivacyGroupReturnsCorrectError() {
final Throwable throwable =
catchThrowable(() -> alice.execute(privacyTransactions.createPrivacyGroup(null, null)));
final String orionMessage = JsonRpcError.CREATE_GROUP_INCLUDE_SELF.getMessage();
final String tesseraMessage = JsonRpcError.TESSERA_CREATE_GROUP_INCLUDE_SELF.getMessage();

assertThat(throwable.getMessage())
.has(matchOrionOrTesseraMessage(orionMessage, tesseraMessage));
assertThat(throwable.getMessage()).has(matchTesseraEnclaveMessage(tesseraMessage));
}

private Condition<String> matchOrionOrTesseraMessage(
final String orionMessage, final String tesseraMessage) {
private Condition<String> matchTesseraEnclaveMessage(final String enclaveMessage) {
return new Condition<>(
message -> message.contains(orionMessage) || message.contains(tesseraMessage),
"Message did not match either Orion or Tessera expected output");
message -> message.contains(enclaveMessage),
"Message did not match Tessera expected output");
}
}

0 comments on commit 62a95ab

Please sign in to comment.