|
|
|
@ -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"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|