From 4110a6b1d9de96b4f35cf696dc340d2419976cbb Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Tue, 20 Jun 2023 18:19:59 +0100 Subject: publishLcmEventBatchAsynchronously is not async Spring @Async has a limitation where calling the async method from within the same class won't work, as the method needs to be proxied, and calling from the same class bypasses the proxy and calls the underlying method directly, thus running synchronously. Issue-ID: CPS-1749 Signed-off-by: danielhanrahan Change-Id: I7f198487dc18b359654dc38b5cf8fd600d33e189 --- .../api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cps-ncmp-service/src/test/groovy') diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy index e449d65ac2..bfebc44bae 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy @@ -39,7 +39,8 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification { def mockLcmEventsCreator = Mock(LcmEventsCreator) def mockLcmEventsService = Mock(LcmEventsService) - def objectUnderTest = new LcmEventsCmHandleStateHandlerImpl(mockInventoryPersistence, mockLcmEventsCreator, mockLcmEventsService) + def lcmEventsCmHandleStateHandlerAsyncHelper = new LcmEventsCmHandleStateHandlerAsyncHelper(mockLcmEventsCreator, mockLcmEventsService) + def objectUnderTest = new LcmEventsCmHandleStateHandlerImpl(mockInventoryPersistence, lcmEventsCmHandleStateHandlerAsyncHelper) def cmHandleId = 'cmhandle-id-1' def compositeState -- cgit 1.2.3-korg