Migrate CPS to Spring-boot 3.0
[cps.git] / cps-service / src / main / java / org / onap / cps / notification / NotificationProperties.java
index eb75e3f..b8a7144 100644 (file)
 
 package org.onap.cps.notification;
 
+import jakarta.validation.constraints.NotNull;
 import java.util.Collections;
 import java.util.Map;
-import javax.validation.constraints.NotNull;
 import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.stereotype.Component;
 import org.springframework.validation.annotation.Validated;
@@ -36,6 +37,7 @@ public class NotificationProperties {
     @NotNull
     private String topic;
     private Map<String, String> filters = Collections.emptyMap();
-    @NotNull
-    private boolean enabled = false;
+
+    @Value("${notification.enabled:true}")
+    private boolean enabled;
 }