[Module Sync] Log state changes after persistence 08/139308/5
authordanielhanrahan <daniel.hanrahan@est.tech>
Fri, 25 Oct 2024 15:28:17 +0000 (16:28 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Fri, 1 Nov 2024 17:29:20 +0000 (17:29 +0000)
commit8271b8749da78e0ed44a716f22dec2183d8f39b2
treebd9052e13e64f31b9c267ac105c456bcc4950fa7
parent9f680eedc69de5aadd4c905c242fbabb232ad106
[Module Sync] Log state changes after persistence

Currently, module sync will output messages such as:
  "cm-handle-1 is now in READY state"
before the state change is persisted to the DB. If an exception
occurs, the new state may not be persisted, which makes debugging
hard due to misleading log entries. This commit moves the logging to
the LCM state handler immediately after the change is persisted.

- Move logging of state changes to LcmEventsCmHandleStateHandler.
- Remove unused code in LcmEventsCmHandleStateHandler.
- Add tests of state change logging.
- Update the main test showing the bug to instead show expected
  behaviour, but disable test for now using @Ignore.

Issue-ID: CPS-2474
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I58646af6df95e07e69ca525744713a7c01c25e41
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutor.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasks.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandler.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandlerAsyncHelper.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandlerImpl.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasksSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
docs/api/swagger/ncmp/openapi-inventory.yaml
docs/api/swagger/ncmp/openapi.yaml