+
+ def 'Update subscription event when the model loader flag is enabled'() {
+ given: 'subscription model loader is enabled as per #scenario'
+ objectUnderTest.subscriptionModelLoaderEnabled = isSubscriptionModelLoaderEnabled
+ when: 'the valid event is consumed'
+ objectUnderTest.consumeSubscriptionEventResponse(consumerRecord)
+ then: 'the forwarded subscription event cache does not return dmiName for the subscription create event'
+ 1 * mockForwardedSubscriptionEventCache.containsKey('some-client-idsome-subscription-name') >> false
+ and: 'the mapper returns yang model subscription event with #numberOfExpectedCall'
+ numberOfExpectedCall * mockSubscriptionEventResponseMapper.toYangModelSubscriptionEvent(_)
+ and: 'subscription event has been updated into DB with #numberOfExpectedCall'
+ numberOfExpectedCall * mockSubscriptionPersistence.saveSubscriptionEvent(_)
+ where: 'the following values are used'
+ scenario | isSubscriptionModelLoaderEnabled || numberOfExpectedCall
+ 'The event is updated' | true || 1
+ 'The event is not updated' | false || 0
+ }