Skip to content

Commit

Permalink
add unit test for getKeyDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed May 5, 2022
1 parent 65501eb commit afd0cc6
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1107,4 +1107,24 @@ class ProjectManagerServiceSpec extends RundeckHibernateSpec implements ServiceU
'a description' | 'a description'
null | null
}

def "getKeyDiff"() {
given:
Properties orig = new Properties()
orig.putAll([a: 'aaa', b: 'bbb'])
Properties newvals = new Properties()
newvals.putAll(newprops)
when:
def result = ProjectManagerService.getKeyDiff(orig, newvals)
then:
result == expected.toSet()
where:
newprops | expected
[a: 'aaa', b: 'bbb'] | []
[a: 'XXX', b: 'bbb'] | ['a']
[b: 'bbb'] | ['a']
[a: 'aaa', b: 'XXX'] | ['b']
[a: 'aaa'] | ['b']
[:] | ['a', 'b']
}
}

0 comments on commit afd0cc6

Please sign in to comment.