diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-22 14:52:24 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-22 14:52:47 +0800 |
commit | 72b1f4d78f6efd6995082386d589410ea69414ab (patch) | |
tree | d0b9f08421e01fc066394344db9816cd7e4192b5 | |
parent | 7c7805206dd2f3cbf9e7e8e55f4fbe6f6088e13c (diff) |
Add backend Code for customer management UI page
Change-Id: Id85157705fa769f5b9d59ef7d77a1856ca69eec7
Issue-ID: USECASEUI-213
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
3 files changed, 13 insertions, 4 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomer.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomer.java index e0511e18..cc37d18b 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomer.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomer.java @@ -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; + } } diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomerTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomerTest.java index 85f5e1fd..db8806fc 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomerTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomerTest.java @@ -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(); diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerServiceTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerServiceTest.java index 16a34abb..8bdd2539 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerServiceTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerServiceTest.java @@ -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); } |