summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2019-05-22 14:52:24 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2019-05-22 14:52:47 +0800
commit72b1f4d78f6efd6995082386d589410ea69414ab (patch)
treed0b9f08421e01fc066394344db9816cd7e4192b5
parent7c7805206dd2f3cbf9e7e8e55f4fbe6f6088e13c (diff)
Add backend Code for customer management UI page
Change-Id: Id85157705fa769f5b9d59ef7d77a1856ca69eec7 Issue-ID: USECASEUI-213 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomer.java11
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAICustomerTest.java2
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerServiceTest.java4
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);
}