additional teststo cover different builder scenerios.
@@ -3,6 +3,7 @@ package com.quorum.tessera.transaction;
import com.quorum.tessera.enclave.PrivacyMode;
import org.junit.Test;
+
import static org.assertj.core.api.Assertions.assertThat;
public class ReceiveResponseTest {
@@ -18,4 +19,28 @@ public class ReceiveResponseTest {
assertThat(result.getPrivacyMode()).isEqualTo(PrivacyMode.STANDARD_PRIVATE);
}
+ @Test(expected = NullPointerException.class)
+ public void execHashRequiredFromPrivacyStateValidation() {
+ byte[] someData = "SomeData".getBytes();
+ ReceiveResponse.Builder.create()
+ .withPrivacyMode(PrivacyMode.PRIVATE_STATE_VALIDATION)
+ .withUnencryptedTransactionData(someData).build();
+
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void privacyModeIsRequired() {
+ byte[] someData = "SomeData".getBytes();
+ ReceiveResponse.Builder.create()
+ .withUnencryptedTransactionData(someData).build();
+
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void unencryptedTransactionDataIsRequired() {
+ ReceiveResponse.Builder.create()
+ .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)
+ .build();
+
+ }
}
