summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
ade5a6e)
- introduced a control switch and keeping it as false due to init issues
Issue-ID: CPS-1537
Change-Id: I8455a5ff6fea09527c6f810ffbc620b4e38c488c
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
\r
modules-sync-watchdog:\r
async-executor:\r
\r
modules-sync-watchdog:\r
async-executor:\r
- parallelism-level: 10
\ No newline at end of file
+ parallelism-level: 10\r
+\r
+ model-loader:\r
+ subscription: false
\ No newline at end of file
import org.onap.cps.api.CpsModuleService;
import org.onap.cps.ncmp.api.impl.exception.NcmpStartUpException;
import org.onap.cps.spi.exceptions.AlreadyDefinedException;
import org.onap.cps.api.CpsModuleService;
import org.onap.cps.ncmp.api.impl.exception.NcmpStartUpException;
import org.onap.cps.spi.exceptions.AlreadyDefinedException;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.stereotype.Component;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.stereotype.Component;
private static final String SUBSCRIPTION_ANCHOR_NAME = "AVC-Subscriptions";
private static final String SUBSCRIPTION_SCHEMASET_NAME = "subscriptions";
private static final String SUBSCRIPTION_ANCHOR_NAME = "AVC-Subscriptions";
private static final String SUBSCRIPTION_SCHEMASET_NAME = "subscriptions";
+ @Value("${ncmp.model-loader.subscription:false}")
+ private boolean subscriptionModelLoaderEnabled;
+
/**
* Method calls boarding subscription model when Application is ready.
*
/**
* Method calls boarding subscription model when Application is ready.
*
@Override
public void onApplicationEvent(@NonNull final ApplicationReadyEvent applicationReadyEvent) {
try {
@Override
public void onApplicationEvent(@NonNull final ApplicationReadyEvent applicationReadyEvent) {
try {
- onboardSubscriptionModel();
+ if (subscriptionModelLoaderEnabled) {
+ onboardSubscriptionModel();
+ } else {
+ log.info("Subscription Model Loader is disabled");
+ }
} catch (final NcmpStartUpException ncmpStartUpException) {
log.debug("Onboarding model for NCMP failed: {} ", ncmpStartUpException.getMessage());
SpringApplication.exit(applicationReadyEvent.getApplicationContext(), () -> 1);
} catch (final NcmpStartUpException ncmpStartUpException) {
log.debug("Onboarding model for NCMP failed: {} ", ncmpStartUpException.getMessage());
SpringApplication.exit(applicationReadyEvent.getApplicationContext(), () -> 1);
}
def 'Onboard subscription model successfully via application ready event'() {
}
def 'Onboard subscription model successfully via application ready event'() {
- when: 'the application is ready'
+ when:'model loader is enabled'
+ objectUnderTest.subscriptionModelLoaderEnabled = true
+ and: 'the application is ready'
objectUnderTest.onApplicationEvent(applicationReadyEvent)
then: 'the module service to create schema set is called once'
1 * mockCpsModuleService.createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME,sampleYangContentMap)
objectUnderTest.onApplicationEvent(applicationReadyEvent)
then: 'the module service to create schema set is called once'
1 * mockCpsModuleService.createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME,sampleYangContentMap)
modules-sync-watchdog:
async-executor:
modules-sync-watchdog:
async-executor:
- parallelism-level: 3
\ No newline at end of file
+ parallelism-level: 3
+
+ model-loader:
+ subscription: true
\ No newline at end of file