diff options
author | Bruno Sakoto <bruno.sakoto@bell.ca> | 2021-07-15 08:55:54 -0400 |
---|---|---|
committer | Bruno Sakoto <bruno.sakoto@bell.ca> | 2021-07-20 16:00:13 -0400 |
commit | 092d4a0b4eb6011b16d223f0c1d5072fdb5f6abb (patch) | |
tree | 610f223d10a531928a239077be07b643d799cb47 /src/test | |
parent | 097707d886a8f59b8c5f994274f6347985ac8c6f (diff) |
Add failing event to invalid event exception
Also avoid unecessary null checks when validating the event
Issue-ID: CPS-494
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: I199fcf42928253bb4f44b204f72a4f46c1cc1eef
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/groovy/org/onap/cps/temporal/controller/event/listener/kafka/DataUpdatedEventListenerSpec.groovy | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/groovy/org/onap/cps/temporal/controller/event/listener/kafka/DataUpdatedEventListenerSpec.groovy b/src/test/groovy/org/onap/cps/temporal/controller/event/listener/kafka/DataUpdatedEventListenerSpec.groovy index d3a407c..35ed977 100644 --- a/src/test/groovy/org/onap/cps/temporal/controller/event/listener/kafka/DataUpdatedEventListenerSpec.groovy +++ b/src/test/groovy/org/onap/cps/temporal/controller/event/listener/kafka/DataUpdatedEventListenerSpec.groovy @@ -78,6 +78,7 @@ class DataUpdatedEventListenerSpec extends Specification { objectUnderTest.consume(invalidEvent) then: 'an exception is thrown with 4 invalid fields' def e = thrown(InvalidEventEnvelopException) + e.getCpsDataUpdatedEvent() == invalidEvent e.getInvalidFields().size() == 4 e.getInvalidFields().contains( new InvalidEventEnvelopException.InvalidField( @@ -104,6 +105,7 @@ class DataUpdatedEventListenerSpec extends Specification { objectUnderTest.consume(invalidEvent) then: 'an exception is thrown with 2 invalid fields' def e = thrown(InvalidEventEnvelopException) + e.getCpsDataUpdatedEvent() == invalidEvent e.getInvalidFields().size() == 2 e.getInvalidFields().contains( new InvalidEventEnvelopException.InvalidField( |