diff options
author | 2019-05-30 14:10:09 +0200 | |
---|---|---|
committer | 2019-05-30 15:40:37 +0200 | |
commit | 10665c85e94a88d02f1218609fbd17465257764d (patch) | |
tree | 5008b9c9dea33b3d93caccc9bdf03b162f6f884f /prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java | |
parent | dc98386e6e888cc0e0c54bc9e984c9d0ada5e73a (diff) |
Fix Sonar issues
Change-Id: If7134bf3b5aabdba6d057562ae863b40412e2d6b
Issue-ID: DCAEGEN2-1501
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java')
-rw-r--r-- | prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java index 0cf07a0f..74de87b0 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java @@ -52,6 +52,7 @@ import java.util.Optional; @Primary public class CbsConfiguration extends PrhAppConfig { private static final Logger LOGGER = LoggerFactory.getLogger(CbsConfiguration.class); + private static final String CBS_CONFIG_MISSING = "CBS config missing"; private AaiClientConfiguration aaiClientCBSConfiguration; private MessageRouterPublisher messageRouterPublisher; private MessageRouterSubscriber messageRouterSubscriber; @@ -111,31 +112,31 @@ public class CbsConfiguration extends PrhAppConfig { @Override public MessageRouterPublisher getMessageRouterPublisher() { - return Optional.ofNullable(messageRouterPublisher).orElseThrow(() -> new RuntimeException("CBS config missing")); + return Optional.ofNullable(messageRouterPublisher).orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING)); } @Override public MessageRouterSubscriber getMessageRouterSubscriber() { - return Optional.ofNullable(messageRouterSubscriber).orElseThrow(() -> new RuntimeException("CBS config missing")); + return Optional.ofNullable(messageRouterSubscriber).orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING)); } @Override public MessageRouterPublishRequest getMessageRouterPublishRequest() { - return Optional.ofNullable(messageRouterCBSPublishRequest).orElseThrow(() -> new RuntimeException("CBS config missing")); + return Optional.ofNullable(messageRouterCBSPublishRequest).orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING)); } @Override public MessageRouterPublishRequest getMessageRouterUpdatePublishRequest() { - return Optional.ofNullable(messageRouterCBSUpdatePublishRequest).orElseThrow(() -> new RuntimeException("CBS config missing")); + return Optional.ofNullable(messageRouterCBSUpdatePublishRequest).orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING)); } @Override public AaiClientConfiguration getAaiClientConfiguration() { - return Optional.ofNullable(aaiClientCBSConfiguration).orElseThrow(() -> new RuntimeException("CBS config missing")); + return Optional.ofNullable(aaiClientCBSConfiguration).orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING)); } @Override public MessageRouterSubscribeRequest getMessageRouterSubscribeRequest() { - return Optional.ofNullable(messageRouterCBSSubscribeRequest).orElseThrow(() -> new RuntimeException("CBS config missing")); + return Optional.ofNullable(messageRouterCBSSubscribeRequest).orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING)); } } |