diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2017-10-26 14:22:17 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2017-10-26 14:22:44 +0800 |
commit | 9fee0341baef9f202328bb5585b1fb86025d33d3 (patch) | |
tree | 80eddc5cc74a3230fa9f5b580243c7ecd09bb477 | |
parent | ea1f8aaf0748e07a0419d564caabea56e0e42738 (diff) |
add auth header
Change-Id: I55d565391c6ec1d9e58a2b128944a1297b2dabc3
Issue-id: USECASEUI-53
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
3 files changed, 29 insertions, 11 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/bean/Vnf.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/bean/Vnf.java index b958e9b2..ca3b9c11 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/bean/Vnf.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/bean/Vnf.java @@ -30,28 +30,30 @@ public class Vnf { private String name; - @JsonCreator - public Vnf( - @JsonProperty String uuid, - @JsonProperty String invariantUUID, - @JsonProperty String name) { - this.uuid = uuid; - this.invariantUUID = invariantUUID; - this.name = name; - } - public String getUuid() { return uuid; } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public String getInvariantUUID() { return invariantUUID; } + public void setInvariantUUID(String invariantUUID) { + this.invariantUUID = invariantUUID; + } + public String getName() { return name; } + public void setName(String name) { + this.name = name; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java index 6e06e012..4b21ec90 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java @@ -24,12 +24,24 @@ import retrofit2.http.*; public interface SOService { + @Headers({ + "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", + "Accept: application/json" + }) @POST("/api/e2eServiceInstances/v3") Call<ServiceOperation> instantiateService(@Body RequestBody body); + @Headers({ + "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", + "Accept: application/json" + }) @GET("/api/e2eServiceInstances/v3/{serviceId}/operations/{operationId}") Call<OperationProgressInformation> queryOperationProgress(@Path("serviceId") String serviceId, @Path("operationId") String operationId); + @Headers({ + "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", + "Accept: application/json" + }) @DELETE("/api/e2eServiceInstances/v3/{serviceId}") Call<DeleteOperationRsp> terminateService(@Path("serviceId") String serviceId); } diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionServiceTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionServiceTest.java index f7009b18..56a2377a 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionServiceTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionServiceTest.java @@ -49,7 +49,11 @@ public class DefaultPackageDistributionServiceTest { @Test public void itCanRetrievePackageFromSDCAndAAI() { List<SDCServiceTemplate> serviceTemplate = Collections.singletonList(new SDCServiceTemplate("1", "1", "service", "V1","", "")); - List<Vnf> vnf = Collections.singletonList(new Vnf("2","2","vnf")); + Vnf o = new Vnf(); + o.setInvariantUUID("2"); + o.setUuid("2"); + o.setName("vnf"); + List<Vnf> vnf = Collections.singletonList(o); SDCCatalogService sdcService = newSDCService(serviceTemplate, vnf); List<VimInfo> vim = Collections.singletonList(new VimInfo("owner", "regionId")); |