Add backend Code for customer management UI page 26/88226/1
authorguochuyicmri <guochuyi@chinamobile.com>
Wed, 22 May 2019 06:52:24 +0000 (14:52 +0800)
committerguochuyicmri <guochuyi@chinamobile.com>
Wed, 22 May 2019 06:52:47 +0000 (14:52 +0800)
Change-Id: Id85157705fa769f5b9d59ef7d77a1856ca69eec7
Issue-ID: USECASEUI-213
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomer.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomerTest.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerServiceTest.java

index e0511e1..cc37d18 100644 (file)
@@ -27,15 +27,19 @@ public class AAICustomer {
     private String subscriberName;
 
     private String subscriberType;
+    
+    private String resourceVersion;
 
     @JsonCreator
     public AAICustomer(
             @JsonProperty("global-customer-id") String globalCustomerId,
             @JsonProperty("subscriber-name") String subscriberName,
-            @JsonProperty("subscriber-type") String subscriberType) {
+            @JsonProperty("subscriber-type") String subscriberType,
+            @JsonProperty("resource-version") String resourceVersion) {
         this.globalCustomerId = globalCustomerId;
         this.subscriberName = subscriberName;
         this.subscriberType = subscriberType;
+        this.resourceVersion = resourceVersion;
     }
 
     @JsonProperty("global-customer-id")
@@ -52,4 +56,9 @@ public class AAICustomer {
     public String getSubscriberType() {
         return subscriberType;
     }
+    
+    @JsonProperty("resource-version")
+    public String getResourceVersion() {
+        return resourceVersion;
+    }
 }
index 85f5e1f..db8806f 100644 (file)
@@ -52,7 +52,7 @@ public class AAICustomerTest {
 
        @Test
        public void testAAICustomer() throws Exception {
-               AAICustomer ac = new AAICustomer("globalCustomerId", "subscriberName", "subscriberType");
+               AAICustomer ac = new AAICustomer("globalCustomerId", "subscriberName", "subscriberType","resourceVersion");
                ac.getGlobalCustomerId();
                ac.getSubscriberName();
                ac.getSubscriberType();
index 16a34ab..8bdd253 100644 (file)
@@ -47,7 +47,7 @@ public class DefaultCustomerServiceTest {
        
     @Test
     public void itCanRetrieveCustomersFromAAI() {
-        List<AAICustomer> customers = singletonList(new AAICustomer("1", "name", "type"));
+        List<AAICustomer> customers = singletonList(new AAICustomer("1", "name", "type","version"));
 
         AAIService aaiService = mock(AAIService.class);
         AAICustomerRsp rsp = new AAICustomerRsp();
@@ -154,7 +154,7 @@ public class DefaultCustomerServiceTest {
         AAIService aaiService = mock(AAIService.class);
         CustomerService customerService = new DefaultCustomerService(aaiService);
         String customerId="1";
-        AAICustomer customer = new AAICustomer(customerId, customerId, customerId);
+        AAICustomer customer = new AAICustomer(customerId, customerId, customerId,customerId);
         when(aaiService.getCustomerById(eq(customerId))).thenReturn(successfulCall(customer));
         customerService.getCustomerById(customerId);
     }