summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java1
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java4
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateSpec.groovy3
-rw-r--r--cps-ncmp-service/src/test/resources/expectedStateModel.json6
4 files changed, 10 insertions, 4 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
index d4c64eac90..65e03f1f9d 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
@@ -90,6 +90,7 @@ public class YangModelCmHandle {
yangModelCmHandle.setDmiProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getDmiProperties()));
yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties(
ncmpServiceCmHandle.getPublicProperties()));
+ yangModelCmHandle.setCompositeState(ncmpServiceCmHandle.getCompositeState());
return yangModelCmHandle;
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java
index 6811b59e00..963b484ed7 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java
@@ -27,6 +27,7 @@ import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
+import org.onap.cps.ncmp.api.inventory.CompositeState;
import org.springframework.validation.annotation.Validated;
/**
@@ -47,4 +48,7 @@ public class NcmpServiceCmHandle {
@JsonSetter(nulls = Nulls.AS_EMPTY)
private Map<String, String> publicProperties = Collections.emptyMap();
+ @JsonSetter(nulls = Nulls.AS_EMPTY)
+ private CompositeState compositeState;
+
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateSpec.groovy
index 4f4cccfe74..59c9951d47 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateSpec.groovy
@@ -36,7 +36,8 @@ import static org.springframework.util.StringUtils.trimAllWhitespace
class CompositeStateSpec extends Specification {
- def formattedDateAndTime = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(OffsetDateTime.of(2022, 1, 1, 1, 1, 1, 1, ZoneOffset.MIN))
+ def formattedDateAndTime = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
+ .format(OffsetDateTime.of(2022, 12, 31, 20, 30, 40, 1, ZoneOffset.UTC))
def objectMapper = new ObjectMapper()
def "Composite State Specification"() {
diff --git a/cps-ncmp-service/src/test/resources/expectedStateModel.json b/cps-ncmp-service/src/test/resources/expectedStateModel.json
index a416194343..f68d725edb 100644
--- a/cps-ncmp-service/src/test/resources/expectedStateModel.json
+++ b/cps-ncmp-service/src/test/resources/expectedStateModel.json
@@ -4,16 +4,16 @@
"reason" : "lock-reason",
"details" : "lock-misbehaving-details"
},
- "last-update-time" : "2022-01-01T01:01:01.000-1800",
+ "last-update-time" : "2022-12-31T20:30:40.000+0000",
"data-sync-enabled" : false,
"datastores" : {
"operational" : {
"sync-state" : "NONE_REQUESTED",
- "last-sync-time" : "2022-01-01T01:01:01.000-1800"
+ "last-sync-time" : "2022-12-31T20:30:40.000+0000"
},
"running" : {
"sync-state" : "NONE_REQUESTED",
- "last-sync-time" : "2022-01-01T01:01:01.000-1800"
+ "last-sync-time" : "2022-12-31T20:30:40.000+0000"
}
}
} \ No newline at end of file