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.jetbrains.annotations.NotNull;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EServiceInstanceRequest;
33 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.ModelConfig;
34 import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService;
35 import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
36 import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp;
37 import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation;
38 import retrofit2.Call;
39 import retrofit2.Callback;
41 import jakarta.annotation.Nullable;
42 import java.io.IOException;
43 import java.io.InputStream;
44 import java.nio.ByteBuffer;
45 import java.nio.charset.Charset;
46 import java.util.HashMap;
48 import static org.mockito.Mockito.any;
49 import static org.mockito.Mockito.anyString;
50 import static org.mockito.Mockito.mock;
51 import static org.mockito.Mockito.when;
52 import static org.onap.usecaseui.server.util.CallStub.failedCall;
54 public class SotnServiceTemplateServiceImplTest {
56 AAIService aaiService;
58 ServiceOperation serviceOperation;
59 SotnServiceTemplateServiceImpl sotnServiceTemplateService;
62 public void before() throws Exception {
63 aaiService = mock(AAIService.class);
64 soService = mock(SOService.class);
65 sotnServiceTemplateService = new SotnServiceTemplateServiceImpl();
66 sotnServiceTemplateService.setSoService(soService);
67 sotnServiceTemplateService.setAaiService(aaiService);
71 public void instantiate_CCVPN_ServiceTest() {
73 HashMap<String, Object> map = new HashMap<>();
75 map.put("description","23");
76 map.put("l2vpn","34");
77 map.put("sotnUni","45");
78 Call<ServiceOperation> call = getSosCall();
79 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
80 sotnServiceTemplateService.instantiate_CCVPN_Service(map);
84 public void instantiate_CCVPN_ServiceWithThrowException() {
85 HashMap<String, Object> map = new HashMap<>();
87 map.put("description","23");
88 map.put("l2vpn","34");
89 map.put("sotnUni","45");
90 Call<ServiceOperation> call = getSosCall();
91 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
92 sotnServiceTemplateService.instantiate_CCVPN_Service(map);
96 public void createSotnServiceTest() {
97 Call<ServiceOperation> call = getSosCall();
98 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
99 sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
103 public void createSotnServiceWithThrowException() {
104 Call<ServiceOperation> call = getSosCall();
105 when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
106 sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
110 public void getServiceInstancesInfoTest() throws Exception {
111 Call<ResponseBody> call = getAaiCall("ServiceInstance");
112 when(aaiService.getServiceInstancesForEdge("ISAAC","SOTN","ISAAC")).thenReturn(call);
113 sotnServiceTemplateService.getServiceInstancesInfo("ISAAC","SOTN","ISAAC");
117 public void getServiceInstancesInfoWithThrowException() throws Exception {
118 Call<ResponseBody> call = getAaiCall("ServiceInstance");
119 when(aaiService.getServiceInstancesForEdge("ISAAC","SOTN","ISAAC")).thenReturn(call);
120 sotnServiceTemplateService.getServiceInstancesInfo("ISAAC","SOTN","ISAAC");
124 public void getTerminationPointTest() throws Exception {
125 Call<ResponseBody> call = getAaiCall("Pinterface");
126 when(aaiService.getTerminationPoint("SOTN","123")).thenReturn(call);
127 sotnServiceTemplateService.getTerminationPoint("SOTN", "123");
131 public void getTerminationPointWithThrowException() throws Exception {
132 Call<ResponseBody> call = getAaiCall("Pinterface");
133 when(aaiService.getTerminationPoint("SOTN","123")).thenReturn(call);
134 sotnServiceTemplateService.getTerminationPoint("SOTN", "123");
138 public void getSOTNPinterfaceByVpnIdTest() throws Exception {
139 Call<ResponseBody> call = getAaiCall("VpnBinding");
141 when(aaiService.getPinterfaceByVpnId("1")).thenReturn(call);
142 sotnServiceTemplateService.getSOTNPinterfaceByVpnId("1");
146 public void getSOTNPinterfaceByVpnIdWithThrowException() throws Exception {
147 Call<ResponseBody> call = getAaiCall("VpnBinding");
148 when(aaiService.getPinterfaceByVpnId("1")).thenReturn(call);
149 sotnServiceTemplateService.getSOTNPinterfaceByVpnId("1");
153 public void getSOTNPnfTest() throws Exception {
154 Call<ResponseBody> call = getAaiCall("Pnf");
155 when(aaiService.getPnfInfo("test")).thenReturn(call);
156 sotnServiceTemplateService.getSOTNPnf("test");
160 public void getSOTNPnfWithThrowException() throws Exception {
161 Call<ResponseBody> call = getAaiCall("Pnf");
162 when(aaiService.getPnfInfo("test")).thenReturn(call);
163 sotnServiceTemplateService.getSOTNPnf("test");
167 public void getSOTNLinkbyNameTest() throws Exception {
168 Call<ResponseBody> call = getAaiCall("LogicalLink");
169 when(aaiService.getSpecificLogicalLink("link")).thenReturn(call);
170 sotnServiceTemplateService.getSOTNLinkbyName("link");
174 public void getSOTNLinkbyNameWithThrowException() throws Exception {
175 Call<ResponseBody> call = getAaiCall("LogicalLink");
176 when(aaiService.getSpecificLogicalLink("link")).thenReturn(call);
177 sotnServiceTemplateService.getSOTNLinkbyName("link");
182 public void getUNIInfoTest() throws Exception {
183 Call<ResponseBody> call = getAaiCall("Uni");
184 when(aaiService.getUNIInfo("uni-id")).thenReturn(call);
185 sotnServiceTemplateService.getUNIInfo("uni-id");
188 public void getUNIInfoWithThrowException() throws Exception {
189 Call<ResponseBody> call = getAaiCall("Uni");
190 when(aaiService.getUNIInfo("uni-id")).thenReturn(call);
191 sotnServiceTemplateService.getUNIInfo("uni-id");
194 public void getVnfsTest() throws Exception {
195 Call<ResponseBody> call = getAaiCall("Vnfs");
196 when(aaiService.getVNFsDetail("vnf-id")).thenReturn(call);
197 sotnServiceTemplateService.getVnfs("vnf-id");
200 public void getVnfsWithThrowException() throws Exception {
201 Call<ResponseBody> call = getAaiCall("Vnfs");
202 when(aaiService.getVNFsDetail("vnf-id")).thenReturn(call);
203 sotnServiceTemplateService.getVnfs("vnf-id");
206 public void getReadFile_unniTest() throws Exception {
207 ModelConfig mdl = new ModelConfig();
208 sotnServiceTemplateService.readFile_unni();
211 public void getReadFileTest() throws Exception {
212 ModelConfig mdl = new ModelConfig();
213 sotnServiceTemplateService.readFile();
218 public void getSOTNSiteInformationTopologyTest() throws Exception {
219 Call<ResponseBody> call = getAaiCall("ServiceInstance");
220 Call<ResponseBody> call1 = getAaiCall("AllottedResource");
221 Call<ResponseBody> call2 = getAaiCall("SiteResource");
222 Call<ResponseBody> call3 = getAaiCall("Connectivity");
223 Call<ResponseBody> call4 = getAaiCall("ComplexObj");
224 Call<ResponseBody> call5 = getAaiCall("Pinterface");
225 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
226 when(aaiService.getSiteResourceInfo(anyString())).thenReturn(call2);
227 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
228 when(aaiService.getAllotedResourceFor5G(anyString(),anyString(),anyString(),anyString())).thenReturn(call1);
229 when(aaiService.getComplexObject(anyString())).thenReturn(call4);
230 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call5);
231 sotnServiceTemplateService.getSOTNSiteInformationTopology("SOTN", "ISAAC");
234 public void getSOTNSiteInformationTopologyWithThrowException() throws Exception {
235 Call<ResponseBody> call = getAaiCall("ServiceInstance");
236 Call<ResponseBody> call1 = getAaiCall("AllottedResource");
237 Call<ResponseBody> call2 = getAaiCall("SiteResource");
238 Call<ResponseBody> call3 = getAaiCall("Connectivity");
239 Call<ResponseBody> call4 = getAaiCall("ComplexObj");
240 Call<ResponseBody> call5 = getAaiCall("Pinterface");
241 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
242 when(aaiService.getSiteResourceInfo(anyString())).thenReturn(call2);
243 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
244 when(aaiService.getAllotedResourceFor5G(anyString(),anyString(),anyString(),anyString())).thenReturn(call1);
245 when(aaiService.getComplexObject(anyString())).thenReturn(call4);
246 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call5);
247 sotnServiceTemplateService.getSOTNSiteInformationTopology("SOTN", "ISAAC");
250 public void getServiceTest() throws Exception {
251 Call<ResponseBody> call = getAaiCall("ServiceInstance");
252 Call<ResponseBody> call1 = getAaiCall("AllottedResource");
253 Call<ResponseBody> call2 = getAaiCall("SiteResource");
254 Call<ResponseBody> call3 = getAaiCall("Connectivity");
255 Call<ResponseBody> call4 = getAaiCall("ComplexObj");
256 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
257 when(aaiService.getSiteResourceInfo(anyString())).thenReturn(call2);
258 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
259 when(aaiService.getAllotedResourceFor5G(anyString(),anyString(),anyString(),anyString())).thenReturn(call1);
260 when(aaiService.getComplexObject(anyString())).thenReturn(call4);
261 sotnServiceTemplateService.getService("SOTN", "ISAAC");
264 public void getServiceWithThrowException() throws Exception {
265 Call<ResponseBody> call = getAaiCall("ServiceInstance");
266 ResponseBody result = null;
267 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
268 ResponseBody result1 = null;
269 when(aaiService.getConnectivityInformation("1")).thenReturn(failedCall("Failed to get connectivity"));
270 ResponseBody result2 = null;
271 when(aaiService.getAllotedResourceFor5G("1", "SONT", "ISAAC", "2")).thenReturn(failedCall("failed to get allocated resource"));
272 sotnServiceTemplateService.getService("SOTN", "ISAAC");
275 public void getSOTNServiceInformationTopologyTest() throws Exception {
276 Call<ResponseBody> call = getAaiCall("ServiceInstance");
277 Call<ResponseBody> call1 = getAaiCall("Uni");
278 Call<ResponseBody> call2 = getAaiCall("Vnfs");
279 Call<ResponseBody> call3 = getAaiCall("Connectivity");
280 Call<ResponseBody> call4 = getAaiCall("Pinterface");
281 Call<ResponseBody> call5 = getAaiCall("VpnBinding");
282 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
283 when(aaiService.getUNIInfo(anyString())).thenReturn(call1);
284 when(aaiService.getVNFsDetail(anyString())).thenReturn(call2);
285 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
286 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call4);
287 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call5);
288 sotnServiceTemplateService.getServiceInformationTopology("example-service-type-val-52265", "NNI-001");
291 public void getSOTNServiceInformationTopologyWithThrowException() throws Exception {
292 Call<ResponseBody> call = getAaiCall("ServiceInstance");
293 Call<ResponseBody> call1 = getAaiCall("Uni");
294 Call<ResponseBody> call2 = getAaiCall("Vnfs");
295 Call<ResponseBody> call3 = getAaiCall("Connectivity");
296 Call<ResponseBody> call4 = getAaiCall("Pinterface");
297 Call<ResponseBody> call5 = getAaiCall("VpnBinding");
298 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(call);
299 when(aaiService.getUNIInfo(anyString())).thenReturn(call1);
300 when(aaiService.getVNFsDetail(anyString())).thenReturn(call2);
301 when(aaiService.getConnectivityInformation(anyString())).thenReturn(call3);
302 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call4);
303 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call5);
304 sotnServiceTemplateService.getServiceInformationTopology("SOTN", "ISAAC");
309 public void getVPNBindingInformationTopologyTest() throws Exception {
310 Call<ResponseBody> call = getAaiCall("VpnBinding");
311 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call);
312 Call<ResponseBody> call1 = getAaiCall("Pinterface");
313 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call1);
314 sotnServiceTemplateService.getVPNBindingInformationTopology("example-service-type-val-52265", "NNI-001", "vpn-bind-1");
317 public void getVPNBindingInformationTopologyWithThrowException() throws Exception {
318 Call<ResponseBody> call = getAaiCall("VpnBinding");
319 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(call);
320 Call<ResponseBody> call1 = getAaiCall("Pinterface");
321 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(call1);
322 sotnServiceTemplateService.getVPNBindingInformationTopology("example-service-type-val-52265", "NNI-001", "vpn-bind-1");
326 public void deleteServiceTest() throws Exception {
327 Call<ResponseBody> aaiCall = getAaiCall("ServiceInstance");
328 Call<DeleteOperationRsp> sosCall = getDeleteSosCall();
329 Response result = null;
330 RequestBody requestBody = null;
331 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(aaiCall);
332 when(soService.terminateService(anyString(),any(RequestBody.class))).thenReturn(sosCall);
333 sotnServiceTemplateService.deleteService("NNI-001", "vpn-bind-1");
336 public void deleteServiceWithThrowException() throws Exception {
337 Call<ResponseBody> aaiCall = getAaiCall("ServiceInstance");
338 Call<ServiceOperation> sosCall = getSosCall();
339 Response result = null;
340 RequestBody requestBody = null;
341 when(aaiService.getServiceInstancesForEdge("ISAAC", "example-service-type-val-52265", "NNI-001")).thenReturn(aaiCall);
342 when(soService.terminateService("serviceId",requestBody)).thenReturn(failedCall("failed to delete the server."));
343 sotnServiceTemplateService.deleteService("NNI-001", "vpn-bind-1");
346 public void getNodeTest() throws Exception {
347 sotnServiceTemplateService.getNode("001", "vpn-bind-1","image.png");
350 public void getEdgeTest() throws Exception {
351 sotnServiceTemplateService.getEdge("fromid", "toId");
355 public void getSOTNResourceInformationTopologyTest() throws Exception {
356 Call<ResponseBody> aaiCall = getAaiCall("ServiceInstance");
357 Call<ResponseBody> aaiCall1 = getAaiCall("Connectivity");
358 Call<ResponseBody> aaiCall2 = getAaiCall("Pnf");
359 Call<ResponseBody> aaiCall3 = getAaiCall("Pinterface");
360 Call<ResponseBody> aaiCall4 = getAaiCall("VpnBinding");
361 Call<ResponseBody> aaiCall5 = getAaiCall("LogicalLink");
362 when(aaiService.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(aaiCall);
363 when(aaiService.getConnectivityInformation( anyString())).thenReturn(aaiCall1);
364 when(aaiService.getPnfInfo(anyString())).thenReturn(aaiCall2);
365 when(aaiService.getTerminationPoint(anyString(),anyString())).thenReturn(aaiCall3);
366 when(aaiService.getPinterfaceByVpnId(anyString())).thenReturn(aaiCall4);
367 when(aaiService.getSpecificLogicalLink(anyString())).thenReturn(aaiCall5);
368 sotnServiceTemplateService.getSOTNResourceInformationTopology("example-service-type-val-52265", "NNI-001");
371 public void getSOTNResourceInformationTopologyWithThrowException() throws Exception {
372 ResponseBody result = null;
373 when(aaiService.getServiceInstancesForEdge("ISAAC", "example-service-type-val-52265", "NNI-001")).thenReturn(failedCall("failed to get sotn resource topology."));
374 sotnServiceTemplateService.getSOTNResourceInformationTopology("example-service-type-val-52265", "NNI-001");
378 private Call<ServiceOperation> getSosCall(){
379 Call<ServiceOperation> call = new Call<ServiceOperation>() {
382 public retrofit2.Response<ServiceOperation> execute() throws IOException {
383 ServiceOperation serviceOperation=new ServiceOperation();
384 return retrofit2.Response.success(serviceOperation);
388 public void enqueue(Callback<ServiceOperation> callback) {
393 public boolean isExecuted() {
398 public void cancel() {
403 public boolean isCanceled() {
408 public Call<ServiceOperation> clone() {
413 public Request request() {
419 private Call<DeleteOperationRsp> getDeleteSosCall(){
420 Call<DeleteOperationRsp> call = new Call<DeleteOperationRsp>() {
422 public retrofit2.Response<DeleteOperationRsp> execute() throws IOException {
423 DeleteOperationRsp deleteOperationRsp = new DeleteOperationRsp();
424 return retrofit2.Response.success(deleteOperationRsp);
428 public void enqueue(Callback<DeleteOperationRsp> callback) {
433 public boolean isExecuted() {
438 public void cancel() {
443 public boolean isCanceled() {
448 public Call<DeleteOperationRsp> clone() {
453 public Request request() {
459 private Call<ResponseBody> getAaiCall(String t){
460 Call<ResponseBody> call = new Call<ResponseBody>() {
462 public retrofit2.Response<ResponseBody> execute() throws IOException {
463 ResponseBody responseBody= new ResponseBody() {
466 public MediaType contentType() {
471 public long contentLength() {
473 // TODO: 2021/1/21 长度
474 if(t.equals("ServiceInstance")){
476 }else if(t.equals("Connectivity")){
478 }else if(t.equals("Pinterface")){
480 }else if(t.equals("AllottedResource")){
482 }else if(t.equals("SiteResource")){
484 }else if(t.equals("ComplexObj")){
486 }else if(t.equals("VpnBinding")){
488 }else if(t.equals("Pnf")){
490 }else if(t.equals("LogicalLink")){
492 }else if(t.equals("Uni")){
494 }else if(t.equals("Vnfs")){
501 public BufferedSource source() {
502 BufferedSource bufferedSource = new BufferedSource() {
506 public BufferedSource peek() {
512 public Buffer getBuffer() {
517 public long read(Buffer buffer, long l) throws IOException {
522 public Timeout timeout() {
527 public void close() throws IOException {
532 public boolean isOpen() {
537 public int read(ByteBuffer dst) throws IOException {
542 public Buffer buffer() {
547 public boolean exhausted() throws IOException {
552 public void require(long l) throws IOException {
557 public boolean request(long l) throws IOException {
562 public byte readByte() throws IOException {
567 public short readShort() throws IOException {
572 public short readShortLe() throws IOException {
577 public int readInt() throws IOException {
582 public int readIntLe() throws IOException {
587 public long readLong() throws IOException {
592 public long readLongLe() throws IOException {
597 public long readDecimalLong() throws IOException {
602 public long readHexadecimalUnsignedLong() throws IOException {
607 public void skip(long l) throws IOException {
612 public ByteString readByteString() throws IOException {
617 public ByteString readByteString(long l) throws IOException {
622 public int select(Options options) throws IOException {
627 public byte[] readByteArray() throws IOException {
628 // TODO: 2021/1/21 字符串
629 String s = new String();
630 if(t.equals("ServiceInstance")){
631 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\"}]}}";
632 }else if(t.equals("Connectivity")){
633 s = "{\"connectivity-id\":\"234\",\"bandwidth-profile-name\":18,\"cir\":1591851786568,\"relationship-list\":{\"relationship\":[{\"related-to\":\"vpn-binding\",\"related-link\":\"12/0\"}]}}";
634 }else if(t.equals("Pinterface")){
635 s = "{\"interface-name\":\"234\",\"speed-units\":18,\"port-description\":1591851786568," +
636 "\"speed-value\":\"234\",\"equipment-identifier\":18,\"resource-version\":1591851786568," +
637 "\"in-maint\":\"true\",\"network-ref\":\"23\",\"transparent\":\"34\",\"operational-status\":\"34\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"logical-link\",\"related-link\":\"12/0\"}]}}";
638 }else if(t.equals("AllottedResource")){
639 s = "{\"id\":234,\"selflink\":18,\"model-invariant-id\":12}";
640 }else if(t.equals("SiteResource")){
641 s = "{\"site-resource-id\":\"234\",\"site-resource-name\":18,\"description\":12,\"relationship-list\":{\"relationship\":[{\"related-to\":\"complex\",\"related-link\":\"123/0\"}]}}";
642 }else if(t.equals("ComplexObj")){
643 s = "{\"physical-location-id\":\"234\",\"resource-version\":18,\"physical-location-type\":12,\"city\":\"sd\",\"postal-code\":\"ds\"}";
644 }else if(t.equals("VpnBinding")){
645 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\"}]}}]}";
646 }else if(t.equals("Pnf")){
647 s = "{\"pnf-name\":\"234\",\"pnf-id\":18,\"in-maint\":true}";
648 }else if(t.equals("LogicalLink")){
649 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\"}]}}";;
650 }else if(t.equals("Uni")){
651 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\"}]}}";
652 }else if(t.equals("Vnfs")){
653 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\"}]}}";
655 byte[] bytes = s.getBytes();
660 public byte[] readByteArray(long l) throws IOException {
665 public int read(byte[] bytes) throws IOException {
670 public void readFully(byte[] bytes) throws IOException {
675 public int read(byte[] bytes, int i, int i1) throws IOException {
680 public void readFully(Buffer buffer, long l) throws IOException {
685 public long readAll(Sink sink) throws IOException {
690 public String readUtf8() throws IOException {
695 public String readUtf8(long l) throws IOException {
701 public String readUtf8Line() throws IOException {
706 public String readUtf8LineStrict() throws IOException {
711 public String readUtf8LineStrict(long l) throws IOException {
716 public int readUtf8CodePoint() throws IOException {
721 public String readString(Charset charset) throws IOException {
726 public String readString(long l, Charset charset) throws IOException {
731 public long indexOf(byte b) throws IOException {
736 public long indexOf(byte b, long l) throws IOException {
741 public long indexOf(byte b, long l, long l1) throws IOException {
746 public long indexOf(ByteString byteString) throws IOException {
751 public long indexOf(ByteString byteString, long l) throws IOException {
756 public long indexOfElement(ByteString byteString) throws IOException {
761 public long indexOfElement(ByteString byteString, long l) throws IOException {
766 public boolean rangeEquals(long l, ByteString byteString) throws IOException {
771 public boolean rangeEquals(long l, ByteString byteString, int i, int i1) throws IOException {
776 public InputStream inputStream() {
780 return bufferedSource;
783 return retrofit2.Response.success(200,responseBody);
787 public void enqueue(Callback<ResponseBody> callback) {
792 public boolean isExecuted() {
797 public void cancel() {
802 public boolean isCanceled() {
807 public Call<ResponseBody> clone() {
812 public Request request() {