[MINOR] updating enclave AT code to remove orion references (#3143)

* cleanup orion messages

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/3185/head
Sally MacFarlane 3 years ago committed by GitHub
parent 43e67e0be2
commit 62a95ab08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/EnclaveErrorAcceptanceTest.java

@ -113,11 +113,9 @@ public class EnclaveErrorAcceptanceTest extends PrivacyAcceptanceTestBase {
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
@ -197,17 +195,14 @@ public class EnclaveErrorAcceptanceTest extends PrivacyAcceptanceTestBase {
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");
}
}

Loading…
Cancel
Save