blob: 9f161a9e53864d62f03c2e4ea142e16397811b06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package org.onap.cps.ncmp.api.models
import org.onap.cps.spi.model.ExtendedModuleReference
import spock.lang.Specification
class moduleReferenceSpec extends Specification {
def 'lombok data annotation correctly implements toString() and hashCode() methods'() {
given: 'two moduleReference objects'
def moduleReference1 = new ExtendedModuleReference('module1', "some namespace", '1')
def moduleReference2 = new ExtendedModuleReference('module1', "some namespace", '1')
when: 'lombok generated methods are called'
then: 'the methods exist and behaviour is accurate'
assert moduleReference1.toString() == moduleReference2.toString()
assert moduleReference1.hashCode() == moduleReference2.hashCode()
and: 'therefore equals works as expected'
assert moduleReference1.equals(moduleReference2)
}
}
|