2 * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.usecaseui.server.service.lcm.impl;
18 import okhttp3.MediaType;
19 import okhttp3.Request;
20 import okhttp3.RequestBody;
21 import okhttp3.Response;
22 import okhttp3.ResponseBody;
24 import okio.BufferedSource;
25 import okio.ByteString;
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EServiceInstanceRequest;
32 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.ModelConfig;
33 import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService;
34 import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
35 import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp;
36 import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation;
37 import retrofit2.Call;
38 import retrofit2.Callback;
40 import javax.annotation.Nullable;
41 import java.io.IOException;
42 import java.io.InputStream;
43 import java.nio.ByteBuffer;
44 import java.nio.charset.Charset;
45 import java.util.HashMap;
47 import static org.mockito.Mockito.any;
48 import static org.mockito.Mockito.anyString;
49 import static org.mockito.Mockito.mock;
50 import static org.mockito.Mockito.when;
51 import static org.onap.usecaseui.server.util.CallStub.failedCall;
53 public class SotnServiceTemplateServiceImplTest {
55 AAIService aaiService;
57 ServiceOperation serviceOperation;
58 SotnServiceTemplateServiceImpl sotnServiceTemplateService;
61 public void before() throws Exception {
62 aaiService = mock(AAIService.class);
63 soService = mock(SOService.class);
64 sotnServiceTemplateService = new SotnServiceTemplateServiceImpl();
65 sotnServiceTemplateService.setSoService(soService);
66 sotnServiceTemplateService.setAaiService(aaiService);
70 public void instantiate_CCVPN_ServiceTest() {
72 HashMap<String, Object> map = new HashMap<>();
74 map.put("description","23");
75 map.put("l2vpn","34");
76 map.put("sotnUni","45");
77 Call<ServiceOperation> call = getSosCall();
78 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
79 sotnServiceTemplateService.instantiate_CCVPN_Service(map);
83 public void instantiate_CCVPN_ServiceWithThrowException() {
84 HashMap<String, Object> map = new HashMap<>();
86 map.put("description","23");
87 map.put("l2vpn","34");
88 map.put("sotnUni","45");
89 Call<ServiceOperation> call = getSosCall();
90 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
91 sotnServiceTemplateService.instantiate_CCVPN_Service(map);
95 public void createSotnServiceTest() {
96 Call<ServiceOperation> call = getSosCall();
97 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
98 sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
102 public void createSotnServiceWithThrowException() {
103 Call<ServiceOperation> call = getSosCall();
104 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
105 sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
109 public void getServiceInstancesInfoTest() throws Exception {
110 Call<ResponseBody> call = getAaiCall("ServiceInstance");
111 when(aaiService.getServiceInstancesForEdge("ISAAC","SOTN","ISAAC")).thenReturn(call);
112 sotnServiceTemplateService.getServiceInstancesInfo("ISAAC","SOTN","ISAAC");
116 public void getServiceInstancesInfoWithThrowException() throws Exception {
117 Call<ResponseBody> call = getAaiCall("ServiceInstance");
118 when(aaiService.getServiceInstancesForEdge("ISAAC","SOTN","ISAAC")).thenReturn(call);
119 sotnServiceTemplateService.getServiceInstancesInfo("ISAAC","SOTN","ISAAC");
123 public void getTerminationPointTest() throws Exception {
124 Call<ResponseBody> call = getAaiCall("Pinterface");
125 when(aaiService.getTerminationPoint("SOTN","123")).thenReturn(call);
126 sotnServiceTemplateService.getTerminationPoint("SOTN", "123");
130 public void getTerminationPointWithThrowException() throws Exception {
131 Call<ResponseBody> call = getAaiCall("Pinterface");
132 when(aaiService.getTerminationPoint("SOTN","123")).thenReturn(call);
133 sotnServiceTemplateService.getTerminationPoint("SOTN", "123");
137 public void getSOTNPinterfaceByVpnIdTest() throws Exception {
138 Call<ResponseBody> call = getAaiCall("VpnBinding");
140 when(aaiService.getPinterfaceByVpnId("1")).thenReturn(call);
141 sotnServiceTemplateService.getSOTNPinterfaceByVpnId("1");
145 public void getSOTNPinterfaceByVpnIdWithThrowException() throws Exception {
146 Call<ResponseBody> call = getAaiCall("VpnBinding");
147 when(aaiService.getPinterfaceByVpnId("1")).thenReturn(call);
148 sotnServiceTemplateService.getSOTNPinterfaceByVpnId("1");
152 public void getSOTNPnfTest() throws Exception {
153 Call<ResponseBody> call = getAaiCall("Pnf");
154 when(aaiService.getPnfInfo("test")).thenReturn(call);
155 sotnServiceTemplateService.getSOTNPnf("test");
159 public void getSOTNPnfWithThrowException() throws Exception {
160 Call<ResponseBody> call = getAaiCall("Pnf");
161 when(aaiService.getPnfInfo("test")).thenReturn(call);
162 sotnServiceTemplateService.getSOTNPnf("test");
166 public void getSOTNLinkbyNameTest() throws Exception {
167 Call<ResponseBody> call = getAaiCall("LogicalLink");
168 when(aaiService.getSpecificLogicalLink("link")).thenReturn(call);
169 sotnServiceTemplateService.getSOTNLinkbyName("link");
173 public void getSOTNLinkbyNameWithThrowException() throws Exception {
174 Call<ResponseBody> call = getAaiCall("LogicalLink");
175 when(aaiService.getSpecificLogicalLink("link")).thenReturn(call);
176 sotnServiceTemplateService.getSOTNLinkbyName("link");
181 public void getUNIInfoTest() throws Exception {
182 Call<ResponseBody> call = getAaiCall("Uni");
183 when(aaiService.getUNIInfo("uni-id")).thenReturn(call);
184 sotnServiceTemplateService.getUNIInfo("uni-id");
187 public void getUNIInfoWithThrowException() throws Exception {
188 Call<ResponseBody> call = getAaiCall("Uni");
189 when(aaiService.getUNIInfo("uni-id")).thenReturn(call);
190 sotnServiceTemplateService.getUNIInfo("uni-id");
193 public void getVnfsTest() throws Exception {
194 Call<ResponseBody> call = getAaiCall("Vnfs");
195 when(aaiService.getVNFsDetail("vnf-id")).thenReturn(call);
196 sotnServiceTemplateService.getVnfs("vnf-id");
199 public void getVnfsWithThrowException() throws Exception {
200 Call<ResponseBody> call = getAaiCall("Vnfs");
201 when(aaiService.getVNFsDetail("vnf-id")).thenReturn(call);
202 sotnServiceTemplateService.getVnfs("vnf-id");
205 public void getReadFile_unniTest() throws Exception {
206 ModelConfig mdl = new ModelConfig();
207 sotnServiceTemplateService.readFile_unni();
210 public void getReadFileTest() throws Exception {
211 ModelConfig mdl = new ModelConfig();
212 sotnServiceTemplateService.readFile();
217 public void getSOTNSiteInformationTopologyTest() throws Exception {
218 Call<ResponseBody> call = getAaiCall("ServiceInstance");
219 Call<ResponseBody> call1 = getAaiCall("AllottedResource");
220 Call<ResponseBody> call2 = getAaiCall("SiteResource");
221 Call<ResponseBody> call3 = getAaiCall("Connectivity");
222 Call<ResponseBody> call4 = getAaiCall("ComplexObj");
223 Call<ResponseBody> call5 = getAaiCall("Pinterface");
224 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
225 when(aaiService.getSiteResourceInfo(anyString())).thenReturn(call2);
226 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
227 when(aaiService.getAllotedResourceFor5G(anyString(),anyString(),anyString(),anyString())).thenReturn(call1);
228 when(aaiService.getComplexObject(anyString())).thenReturn(call4);
229 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call5);
230 sotnServiceTemplateService.getSOTNSiteInformationTopology("SOTN", "ISAAC");
233 public void getSOTNSiteInformationTopologyWithThrowException() throws Exception {
234 Call<ResponseBody> call = getAaiCall("ServiceInstance");
235 Call<ResponseBody> call1 = getAaiCall("AllottedResource");
236 Call<ResponseBody> call2 = getAaiCall("SiteResource");
237 Call<ResponseBody> call3 = getAaiCall("Connectivity");
238 Call<ResponseBody> call4 = getAaiCall("ComplexObj");
239 Call<ResponseBody> call5 = getAaiCall("Pinterface");
240 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
241 when(aaiService.getSiteResourceInfo(anyString())).thenReturn(call2);
242 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
243 when(aaiService.getAllotedResourceFor5G(anyString(),anyString(),anyString(),anyString())).thenReturn(call1);
244 when(aaiService.getComplexObject(anyString())).thenReturn(call4);
245 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call5);
246 sotnServiceTemplateService.getSOTNSiteInformationTopology("SOTN", "ISAAC");
249 public void getServiceTest() throws Exception {
250 Call<ResponseBody> call = getAaiCall("ServiceInstance");
251 Call<ResponseBody> call1 = getAaiCall("AllottedResource");
252 Call<ResponseBody> call2 = getAaiCall("SiteResource");
253 Call<ResponseBody> call3 = getAaiCall("Connectivity");
254 Call<ResponseBody> call4 = getAaiCall("ComplexObj");
255 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
256 when(aaiService.getSiteResourceInfo(anyString())).thenReturn(call2);
257 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
258 when(aaiService.getAllotedResourceFor5G(anyString(),anyString(),anyString(),anyString())).thenReturn(call1);
259 when(aaiService.getComplexObject(anyString())).thenReturn(call4);
260 sotnServiceTemplateService.getService("SOTN", "ISAAC");
263 public void getServiceWithThrowException() throws Exception {
264 Call<ResponseBody> call = getAaiCall("ServiceInstance");
265 ResponseBody result = null;
266 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
267 ResponseBody result1 = null;
268 when(aaiService.getConnectivityInformation("1")).thenReturn(failedCall("Failed to get connectivity"));
269 ResponseBody result2 = null;
270 when(aaiService.getAllotedResourceFor5G("1", "SONT", "ISAAC", "2")).thenReturn(failedCall("failed to get allocated resource"));
271 sotnServiceTemplateService.getService("SOTN", "ISAAC");
274 public void getSOTNServiceInformationTopologyTest() throws Exception {
275 Call<ResponseBody> call = getAaiCall("ServiceInstance");
276 Call<ResponseBody> call1 = getAaiCall("Uni");
277 Call<ResponseBody> call2 = getAaiCall("Vnfs");
278 Call<ResponseBody> call3 = getAaiCall("Connectivity");
279 Call<ResponseBody> call4 = getAaiCall("Pinterface");
280 Call<ResponseBody> call5 = getAaiCall("VpnBinding");
281 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
282 when(aaiService.getUNIInfo(anyString())).thenReturn(call1);
283 when(aaiService.getVNFsDetail(anyString())).thenReturn(call2);
284 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
285 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call4);
286 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call5);
287 sotnServiceTemplateService.getServiceInformationTopology("example-service-type-val-52265", "NNI-001");
290 public void getSOTNServiceInformationTopologyWithThrowException() throws Exception {
291 Call<ResponseBody> call = getAaiCall("ServiceInstance");
292 Call<ResponseBody> call1 = getAaiCall("Uni");
293 Call<ResponseBody> call2 = getAaiCall("Vnfs");
294 Call<ResponseBody> call3 = getAaiCall("Connectivity");
295 Call<ResponseBody> call4 = getAaiCall("Pinterface");
296 Call<ResponseBody> call5 = getAaiCall("VpnBinding");
297 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
298 when(aaiService.getUNIInfo(anyString())).thenReturn(call1);
299 when(aaiService.getVNFsDetail(anyString())).thenReturn(call2);
300 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
301 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call4);
302 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call5);
303 sotnServiceTemplateService.getServiceInformationTopology("SOTN", "ISAAC");
308 public void getVPNBindingInformationTopologyTest() throws Exception {
309 Call<ResponseBody> call = getAaiCall("VpnBinding");
310 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call);
311 Call<ResponseBody> call1 = getAaiCall("Pinterface");
312 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call1);
313 sotnServiceTemplateService.getVPNBindingInformationTopology("example-service-type-val-52265", "NNI-001", "vpn-bind-1");
316 public void getVPNBindingInformationTopologyWithThrowException() throws Exception {
317 Call<ResponseBody> call = getAaiCall("VpnBinding");
318 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call);
319 Call<ResponseBody> call1 = getAaiCall("Pinterface");
320 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call1);
321 sotnServiceTemplateService.getVPNBindingInformationTopology("example-service-type-val-52265", "NNI-001", "vpn-bind-1");
325 public void deleteServiceTest() throws Exception {
326 Call<ResponseBody> aaiCall = getAaiCall("ServiceInstance");
327 Call<DeleteOperationRsp> sosCall = getDeleteSosCall();
328 Response result = null;
329 RequestBody requestBody = null;
330 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(aaiCall);
331 when(soService.terminateService(anyString(),any(RequestBody.class))).thenReturn(sosCall);
332 sotnServiceTemplateService.deleteService("NNI-001", "vpn-bind-1");
335 public void deleteServiceWithThrowException() throws Exception {
336 Call<ResponseBody> aaiCall = getAaiCall("ServiceInstance");
337 Call<ServiceOperation> sosCall = getSosCall();
338 Response result = null;
339 RequestBody requestBody = null;
340 when(aaiService.getServiceInstancesForEdge("ISAAC", "example-service-type-val-52265", "NNI-001")).thenReturn(aaiCall);
341 when(soService.terminateService("serviceId",requestBody)).thenReturn(failedCall("failed to delete the server."));
342 sotnServiceTemplateService.deleteService("NNI-001", "vpn-bind-1");
345 public void getNodeTest() throws Exception {
346 sotnServiceTemplateService.getNode("001", "vpn-bind-1","image.png");
349 public void getEdgeTest() throws Exception {
350 sotnServiceTemplateService.getEdge("fromid", "toId");
354 public void getSOTNResourceInformationTopologyTest() throws Exception {
355 Call<ResponseBody> aaiCall = getAaiCall("ServiceInstance");
356 Call<ResponseBody> aaiCall1 = getAaiCall("Connectivity");
357 Call<ResponseBody> aaiCall2 = getAaiCall("Pnf");
358 Call<ResponseBody> aaiCall3 = getAaiCall("Pinterface");
359 Call<ResponseBody> aaiCall4 = getAaiCall("VpnBinding");
360 Call<ResponseBody> aaiCall5 = getAaiCall("LogicalLink");
361 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(aaiCall);
362 when(aaiService.getConnectivityInformation( anyString())).thenReturn(aaiCall1);
363 when(aaiService.getPnfInfo(anyString())).thenReturn(aaiCall2);
364 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(aaiCall3);
365 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(aaiCall4);
366 when(aaiService.getSpecificLogicalLink(anyString())).thenReturn(aaiCall5);
367 sotnServiceTemplateService.getSOTNResourceInformationTopology("example-service-type-val-52265", "NNI-001");
370 public void getSOTNResourceInformationTopologyWithThrowException() throws Exception {
371 ResponseBody result = null;
372 when(aaiService.getServiceInstancesForEdge("ISAAC", "example-service-type-val-52265", "NNI-001")).thenReturn(failedCall("failed to get sotn resource topology."));
373 sotnServiceTemplateService.getSOTNResourceInformationTopology("example-service-type-val-52265", "NNI-001");
377 private Call<ServiceOperation> getSosCall(){
378 Call<ServiceOperation> call = new Call<ServiceOperation>() {
381 public retrofit2.Response<ServiceOperation> execute() throws IOException {
382 ServiceOperation serviceOperation=new ServiceOperation();
383 return retrofit2.Response.success(serviceOperation);
387 public void enqueue(Callback<ServiceOperation> callback) {
392 public boolean isExecuted() {
397 public void cancel() {
402 public boolean isCanceled() {
407 public Call<ServiceOperation> clone() {
412 public Request request() {
418 private Call<DeleteOperationRsp> getDeleteSosCall(){
419 Call<DeleteOperationRsp> call = new Call<DeleteOperationRsp>() {
421 public retrofit2.Response<DeleteOperationRsp> execute() throws IOException {
422 DeleteOperationRsp deleteOperationRsp = new DeleteOperationRsp();
423 return retrofit2.Response.success(deleteOperationRsp);
427 public void enqueue(Callback<DeleteOperationRsp> callback) {
432 public boolean isExecuted() {
437 public void cancel() {
442 public boolean isCanceled() {
447 public Call<DeleteOperationRsp> clone() {
452 public Request request() {
458 private Call<ResponseBody> getAaiCall(String t){
459 Call<ResponseBody> call = new Call<ResponseBody>() {
461 public retrofit2.Response<ResponseBody> execute() throws IOException {
462 ResponseBody responseBody= new ResponseBody() {
465 public MediaType contentType() {
470 public long contentLength() {
472 // TODO: 2021/1/21 长度
473 if(t.equals("ServiceInstance")){
475 }else if(t.equals("Connectivity")){
477 }else if(t.equals("Pinterface")){
479 }else if(t.equals("AllottedResource")){
481 }else if(t.equals("SiteResource")){
483 }else if(t.equals("ComplexObj")){
485 }else if(t.equals("VpnBinding")){
487 }else if(t.equals("Pnf")){
489 }else if(t.equals("LogicalLink")){
491 }else if(t.equals("Uni")){
493 }else if(t.equals("Vnfs")){
500 public BufferedSource source() {
501 BufferedSource bufferedSource = new BufferedSource() {
503 public long read(Buffer buffer, long l) throws IOException {
508 public Timeout timeout() {
513 public void close() throws IOException {
518 public boolean isOpen() {
523 public int read(ByteBuffer dst) throws IOException {
528 public Buffer buffer() {
533 public boolean exhausted() throws IOException {
538 public void require(long l) throws IOException {
543 public boolean request(long l) throws IOException {
548 public byte readByte() throws IOException {
553 public short readShort() throws IOException {
558 public short readShortLe() throws IOException {
563 public int readInt() throws IOException {
568 public int readIntLe() throws IOException {
573 public long readLong() throws IOException {
578 public long readLongLe() throws IOException {
583 public long readDecimalLong() throws IOException {
588 public long readHexadecimalUnsignedLong() throws IOException {
593 public void skip(long l) throws IOException {
598 public ByteString readByteString() throws IOException {
603 public ByteString readByteString(long l) throws IOException {
608 public int select(Options options) throws IOException {
613 public byte[] readByteArray() throws IOException {
614 // TODO: 2021/1/21 å—符串
615 String s = new String();
616 if(t.equals("ServiceInstance")){
617 s = "{\"service-instance-id\":\"234\",\"service-instance-name\":18,\"input-parameters\":\"as\",\"service-type\":1591851786568,\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"related-link\":\"12/0\"},{\"related-to\":\"generic-vnf\",\"related-link\":\"12/0\"},{\"related-to\":\"allotted-resource\",\"related-link\":\"12/0\"},{\"related-to\":\"connectivity\",\"related-link\":\"12/0\"},{\"related-to\":\"site-resource\",\"related-link\":\"12/0\"}]}}";
618 }else if(t.equals("Connectivity")){
619 s = "{\"connectivity-id\":\"234\",\"bandwidth-profile-name\":18,\"cir\":1591851786568,\"relationship-list\":{\"relationship\":[{\"related-to\":\"vpn-binding\",\"related-link\":\"12/0\"}]}}";
620 }else if(t.equals("Pinterface")){
621 s = "{\"interface-name\":\"234\",\"speed-units\":18,\"port-description\":1591851786568," +
622 "\"speed-value\":\"234\",\"equipment-identifier\":18,\"resource-version\":1591851786568," +
623 "\"in-maint\":\"true\",\"network-ref\":\"23\",\"transparent\":\"34\",\"operational-status\":\"34\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"logical-link\",\"related-link\":\"12/0\"}]}}";
624 }else if(t.equals("AllottedResource")){
625 s = "{\"id\":234,\"selflink\":18,\"model-invariant-id\":12}";
626 }else if(t.equals("SiteResource")){
627 s = "{\"site-resource-id\":\"234\",\"site-resource-name\":18,\"description\":12,\"relationship-list\":{\"relationship\":[{\"related-to\":\"complex\",\"related-link\":\"123/0\"}]}}";
628 }else if(t.equals("ComplexObj")){
629 s = "{\"physical-location-id\":\"234\",\"resource-version\":18,\"physical-location-type\":12,\"city\":\"sd\",\"postal-code\":\"ds\"}";
630 }else if(t.equals("VpnBinding")){
631 s = "{\"vpn-binding\":[{\"vpn-id\":23,\"src-access-node-id\":18,\"dst-access-node-id\":18,\"relationship-list\":{\"relationship\":[{\"related-to\":\"p-interface\",\"relationship-data\":[{\"relationship-key\":\"pnf.pnf-name\",\"relationship-value\":\"23\"}],\"related-link\":\"123/2\"}]}}]}";
632 }else if(t.equals("Pnf")){
633 s = "{\"pnf-name\":\"234\",\"pnf-id\":18,\"in-maint\":true}";
634 }else if(t.equals("LogicalLink")){
635 s = "{\"link-name\":\"234\",\"in-maint\":18,\"link-type\":true,\"relationship-list\":{\"relationship\":[{\"related-to\":\"p-interface\",\"relationship-data\":[{\"relationship-key\":\"pnf.pnf-name\",\"relationship-value\":\"26\"}],\"related-link\":\"123/0\"},{\"related-to\":\"ext-aai-network\",\"related-link\":\"123/0\"}]}}";;
636 }else if(t.equals("Uni")){
637 s = "{\"id\":\"234\",\"tpId\":18,\"resource-version\":true,\"relationship-list\":{\"relationship\":[{\"related-to\":\"p-interface\",\"relationship-data\":[{\"relationship-key\":\"pnf.pnf-name\",\"relationship-value\":\"26\"}],\"related-link\":\"123/0\"}]}}";
638 }else if(t.equals("Vnfs")){
639 s = "{\"vnf-id\":\"234\",\"in-maint\":18,\"resource-version\":true,\"relationship-list\":{\"relationship\":[{\"related-to\":\"connectivity\",\"related-link\":\"123/0\"},{\"related-to\":\"uni\",\"related-link\":\"123/0\"}]}}";
641 byte[] bytes = s.getBytes();
646 public byte[] readByteArray(long l) throws IOException {
651 public int read(byte[] bytes) throws IOException {
656 public void readFully(byte[] bytes) throws IOException {
661 public int read(byte[] bytes, int i, int i1) throws IOException {
666 public void readFully(Buffer buffer, long l) throws IOException {
671 public long readAll(Sink sink) throws IOException {
676 public String readUtf8() throws IOException {
681 public String readUtf8(long l) throws IOException {
687 public String readUtf8Line() throws IOException {
692 public String readUtf8LineStrict() throws IOException {
697 public String readUtf8LineStrict(long l) throws IOException {
702 public int readUtf8CodePoint() throws IOException {
707 public String readString(Charset charset) throws IOException {
712 public String readString(long l, Charset charset) throws IOException {
717 public long indexOf(byte b) throws IOException {
722 public long indexOf(byte b, long l) throws IOException {
727 public long indexOf(byte b, long l, long l1) throws IOException {
732 public long indexOf(ByteString byteString) throws IOException {
737 public long indexOf(ByteString byteString, long l) throws IOException {
742 public long indexOfElement(ByteString byteString) throws IOException {
747 public long indexOfElement(ByteString byteString, long l) throws IOException {
752 public boolean rangeEquals(long l, ByteString byteString) throws IOException {
757 public boolean rangeEquals(long l, ByteString byteString, int i, int i1) throws IOException {
762 public InputStream inputStream() {
766 return bufferedSource;
769 return retrofit2.Response.success(200,responseBody);
773 public void enqueue(Callback<ResponseBody> callback) {
778 public boolean isExecuted() {
783 public void cancel() {
788 public boolean isCanceled() {
793 public Call<ResponseBody> clone() {
798 public Request request() {