From 092d4a0b4eb6011b16d223f0c1d5072fdb5f6abb Mon Sep 17 00:00:00 2001 From: Bruno Sakoto Date: Thu, 15 Jul 2021 08:55:54 -0400 Subject: 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 Change-Id: I199fcf42928253bb4f44b204f72a4f46c1cc1eef --- .../controller/event/listener/kafka/DataUpdatedEventListenerSpec.groovy | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/test/groovy') 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( -- cgit 1.2.3-korg