Reduce technical debt and add JUnit
[policy/engine.git] / PolicyEngineAPI / src / main / java / org / onap / policy / std / ManualClientEndUEB.java
index 29c85a2..8590f6a 100644 (file)
@@ -51,35 +51,36 @@ public class ManualClientEndUEB {
        private static String url = null;
        private static String uniquID = null;
        private static String topic = null;
-       
+
+       private ManualClientEndUEB() {
+               // Empty constructor
+       }
 
        public static PDPNotification result(NotificationScheme scheme) {
                if (resultJson == null || notification == null) {
                        logger.debug("No Result" );
                        return null;
-               } else {
-                       if(scheme.equals(NotificationScheme.MANUAL_ALL_NOTIFICATIONS)) {
-                               boolean removed = false, updated = false; 
-                               if(notification.getRemovedPolicies()!=null && !notification.getRemovedPolicies().isEmpty()){
-                                       removed = true;
-                               }
-                               if(notification.getLoadedPolicies()!=null && !notification.getLoadedPolicies().isEmpty()){
-                                       updated = true;
-                               }
-                               if(removed && updated) {
-                                       notification.setNotificationType(NotificationType.BOTH);
-                               }else if(removed){
-                                       notification.setNotificationType(NotificationType.REMOVE);
-                               }else if(updated){
-                                       notification.setNotificationType(NotificationType.UPDATE);
-                               }
-                               return notification;
-                       }else if(scheme.equals(NotificationScheme.MANUAL_NOTIFICATIONS)) {
-                               return MatchStore.checkMatch(notification);
-                       }else {
-                               return null;
+               }
+               if(scheme.equals(NotificationScheme.MANUAL_ALL_NOTIFICATIONS)) {
+                       boolean removed = false, updated = false; 
+                       if(notification.getRemovedPolicies()!=null && !notification.getRemovedPolicies().isEmpty()){
+                               removed = true;
+                       }
+                       if(notification.getLoadedPolicies()!=null && !notification.getLoadedPolicies().isEmpty()){
+                               updated = true;
+                       }
+                       if(removed && updated) {
+                               notification.setNotificationType(NotificationType.BOTH);
+                       }else if(removed){
+                               notification.setNotificationType(NotificationType.REMOVE);
+                       }else if(updated){
+                               notification.setNotificationType(NotificationType.UPDATE);
                        }
+                       return notification;
+               }else if(scheme.equals(NotificationScheme.MANUAL_NOTIFICATIONS)) {
+                       return MatchStore.checkMatch(notification);
                }
+               return null;
        }
 
        private static void publishMessage(String pubTopic, String uniqueID , List<String> uebURLList) {