diff options
author | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2019-05-31 09:04:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-31 09:04:24 +0000 |
commit | dc791333f7820e2e826bf06a60af00b796a7c498 (patch) | |
tree | e6880d6a016d6102b551797938c9be2e279a5f02 /prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java | |
parent | c0d1ad41b36b9a3036ea9451a65f938ce94c0dc8 (diff) | |
parent | 10665c85e94a88d02f1218609fbd17465257764d (diff) |
Merge "Fix Sonar issues"
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 e412bff5..3f018b53 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 @@ -43,6 +43,7 @@ import java.util.Optional; @Configuration public class CbsConfiguration implements Config { 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; @@ -105,31 +106,31 @@ public class CbsConfiguration implements Config { @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)); } } |