Skip to content

Commit

Permalink
PB-13092. Fix bugs in OptionalSignaturesExampleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
john committed Jun 20, 2018
1 parent e89c1a5 commit b678b2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 90 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class OptionalSignaturesExampleTest {

Expand All @@ -12,13 +15,18 @@ public void verifyResult() {
OptionalSignaturesExample example = new OptionalSignaturesExample();
example.run();

assertThat("signer1's signable signatures are not set correctly. ", example.signer1SignableSignatures.size(), hasSize(2));
assertThat("signer1's signable signatures are not set correctly. ", example.signer1SignableSignatures, hasSize(2));
assertThat("signer1's signable signature1 is not set correctly. ", example.signer1SignableSignatures.get(0).getSignerEmail(), is(example.email1));
assertThat("signer1's signable signature2 is not set correctly. ", example.signer1SignableSignatures.get(1).getSignerEmail(), is(example.email1));

assertThat("signer2's signable signatures are not set correctly. ", example.signer2SignableSignatures.size(), hasSize(2));
assertThat("signer2's signable signatures are not set correctly. ", example.signer2SignableSignatures, hasSize(2));
assertThat("signer2's signable signature1 is not set correctly. ", example.signer2SignableSignatures.get(0).getSignerEmail(), is(example.email2));
assertThat("signer2's signable signature2 is not set correctly. ", example.signer2SignableSignatures.get(1).getSignerEmail(), is(example.email2));
assertTrue("signer2's signable signature2 is not optional. ", example.signer2SignableSignatures.get(1).isOptional());

if(example.signer2SignableSignatures.get(0).isOptional()) {
assertFalse("signer2's signable signature2 is not optional. ", example.signer2SignableSignatures.get(1).isOptional());
} else {
assertTrue("signer2's signable signature2 is not optional. ", example.signer2SignableSignatures.get(1).isOptional());
}
}
}

This file was deleted.

0 comments on commit b678b2c

Please sign in to comment.