Skip to content

Commit

Permalink
issue #3446 added test for token version parameter hash
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
  • Loading branch information
punktilious committed Mar 14, 2022
1 parent 46e88ad commit 83ea787
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ public void testNoExtractedParameters() throws Exception {
assertEquals(hash1, hash2);
}

@Test
public void testTokenParams() throws Exception {
TokenParmVal p1 = new TokenParmVal();
p1.setResourceType("Patient");
p1.setName("code2");
p1.setUrl("url2");
p1.setVersion("1");
p1.setValueSystem("valueSystem2");
p1.setValueCode("valueCode2");

ParameterHashVisitor visitor1 = new ParameterHashVisitor();
p1.accept(visitor1);

// Make sure that the hash changes when changing the version
p1.setVersion("2");
ParameterHashVisitor visitor2 = new ParameterHashVisitor();
p1.accept(visitor2);
assertNotEquals(visitor1.getBase64Hash(), visitor2.getBase64Hash());
}

@Test
public void testNullValues() throws Exception {
// Create two number param values, one with null low, and one with null high
Expand Down

0 comments on commit 83ea787

Please sign in to comment.