+
+
+ private Call<ServiceOperation> getSosCall(){
+ Call<ServiceOperation> call = new Call<ServiceOperation>() {
+
+ @Override
+ public retrofit2.Response<ServiceOperation> execute() throws IOException {
+ ServiceOperation serviceOperation=new ServiceOperation();
+ return retrofit2.Response.success(serviceOperation);
+ }
+
+ @Override
+ public void enqueue(Callback<ServiceOperation> callback) {
+
+ }
+
+ @Override
+ public boolean isExecuted() {
+ return false;
+ }
+
+ @Override
+ public void cancel() {
+
+ }
+
+ @Override
+ public boolean isCanceled() {
+ return false;
+ }
+
+ @Override
+ public Call<ServiceOperation> clone() {
+ return null;
+ }
+
+ @Override
+ public Request request() {
+ return null;
+ }
+ };
+ return call;
+ }
+ private Call<DeleteOperationRsp> getDeleteSosCall(){
+ Call<DeleteOperationRsp> call = new Call<DeleteOperationRsp>() {
+ @Override
+ public retrofit2.Response<DeleteOperationRsp> execute() throws IOException {
+ DeleteOperationRsp deleteOperationRsp = new DeleteOperationRsp();
+ return retrofit2.Response.success(deleteOperationRsp);
+ }
+
+ @Override
+ public void enqueue(Callback<DeleteOperationRsp> callback) {
+
+ }
+
+ @Override
+ public boolean isExecuted() {
+ return false;
+ }
+
+ @Override
+ public void cancel() {
+
+ }
+
+ @Override
+ public boolean isCanceled() {
+ return false;
+ }
+
+ @Override
+ public Call<DeleteOperationRsp> clone() {
+ return null;
+ }
+
+ @Override
+ public Request request() {
+ return null;
+ }
+ };
+ return call;
+ }
+ private Call<ResponseBody> getAaiCall(String t){
+ Call<ResponseBody> call = new Call<ResponseBody>() {
+ @Override
+ public retrofit2.Response<ResponseBody> execute() throws IOException {
+ ResponseBody responseBody= new ResponseBody() {
+ @Nullable
+ @Override
+ public MediaType contentType() {
+ return null;
+ }
+
+ @Override
+ public long contentLength() {
+ long lenth = 0;
+ // TODO: 2021/1/21 长度
+ if(t.equals("ServiceInstance")){
+ lenth = 417;
+ }else if(t.equals("Connectivity")){
+ lenth = 163;
+ }else if(t.equals("Pinterface")){
+ lenth = 326;
+ }else if(t.equals("AllottedResource")){
+ lenth = 48;
+ }else if(t.equals("SiteResource")){
+ lenth = 154;
+ }else if(t.equals("ComplexObj")){
+ lenth = 111;
+ }else if(t.equals("VpnBinding")){
+ lenth = 254;
+ }else if(t.equals("Pnf")){
+ lenth = 46;
+ }else if(t.equals("LogicalLink")){
+ lenth = 281;
+ }else if(t.equals("Uni")){
+ lenth = 221;
+ }else if(t.equals("Vnfs")){
+ lenth = 190;
+ }
+ return lenth;
+ }
+
+ @Override
+ public BufferedSource source() {
+ BufferedSource bufferedSource = new BufferedSource() {
+ @Override
+ public long read(Buffer buffer, long l) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public Timeout timeout() {
+ return null;
+ }
+
+ @Override
+ public void close() throws IOException {
+
+ }
+
+ @Override
+ public boolean isOpen() {
+ return false;
+ }
+
+ @Override
+ public int read(ByteBuffer dst) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public Buffer buffer() {
+ return null;
+ }
+
+ @Override
+ public boolean exhausted() throws IOException {
+ return false;
+ }
+
+ @Override
+ public void require(long l) throws IOException {
+
+ }
+
+ @Override
+ public boolean request(long l) throws IOException {
+ return false;
+ }
+
+ @Override
+ public byte readByte() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public short readShort() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public short readShortLe() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public int readInt() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public int readIntLe() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long readLong() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long readLongLe() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long readDecimalLong() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long readHexadecimalUnsignedLong() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public void skip(long l) throws IOException {
+
+ }
+
+ @Override
+ public ByteString readByteString() throws IOException {
+ return null;
+ }
+
+ @Override
+ public ByteString readByteString(long l) throws IOException {
+ return null;
+ }
+
+ @Override
+ public int select(Options options) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public byte[] readByteArray() throws IOException {
+ // TODO: 2021/1/21 字符串
+ String s = new String();
+ if(t.equals("ServiceInstance")){
+ 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\"}]}}";
+ }else if(t.equals("Connectivity")){
+ s = "{\"connectivity-id\":\"234\",\"bandwidth-profile-name\":18,\"cir\":1591851786568,\"relationship-list\":{\"relationship\":[{\"related-to\":\"vpn-binding\",\"related-link\":\"12/0\"}]}}";
+ }else if(t.equals("Pinterface")){
+ s = "{\"interface-name\":\"234\",\"speed-units\":18,\"port-description\":1591851786568," +
+ "\"speed-value\":\"234\",\"equipment-identifier\":18,\"resource-version\":1591851786568," +
+ "\"in-maint\":\"true\",\"network-ref\":\"23\",\"transparent\":\"34\",\"operational-status\":\"34\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"logical-link\",\"related-link\":\"12/0\"}]}}";
+ }else if(t.equals("AllottedResource")){
+ s = "{\"id\":234,\"selflink\":18,\"model-invariant-id\":12}";
+ }else if(t.equals("SiteResource")){
+ s = "{\"site-resource-id\":\"234\",\"site-resource-name\":18,\"description\":12,\"relationship-list\":{\"relationship\":[{\"related-to\":\"complex\",\"related-link\":\"123/0\"}]}}";
+ }else if(t.equals("ComplexObj")){
+ s = "{\"physical-location-id\":\"234\",\"resource-version\":18,\"physical-location-type\":12,\"city\":\"sd\",\"postal-code\":\"ds\"}";
+ }else if(t.equals("VpnBinding")){
+ 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\"}]}}]}";
+ }else if(t.equals("Pnf")){
+ s = "{\"pnf-name\":\"234\",\"pnf-id\":18,\"in-maint\":true}";
+ }else if(t.equals("LogicalLink")){
+ 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\"}]}}";;
+ }else if(t.equals("Uni")){
+ 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\"}]}}";
+ }else if(t.equals("Vnfs")){
+ 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\"}]}}";
+ }
+ byte[] bytes = s.getBytes();
+ return bytes;
+ }
+
+ @Override
+ public byte[] readByteArray(long l) throws IOException {
+ return new byte[0];
+ }
+
+ @Override
+ public int read(byte[] bytes) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public void readFully(byte[] bytes) throws IOException {
+
+ }
+
+ @Override
+ public int read(byte[] bytes, int i, int i1) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public void readFully(Buffer buffer, long l) throws IOException {
+
+ }
+
+ @Override
+ public long readAll(Sink sink) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public String readUtf8() throws IOException {
+ return null;
+ }
+
+ @Override
+ public String readUtf8(long l) throws IOException {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public String readUtf8Line() throws IOException {
+ return null;
+ }
+
+ @Override
+ public String readUtf8LineStrict() throws IOException {
+ return null;
+ }
+
+ @Override
+ public String readUtf8LineStrict(long l) throws IOException {
+ return null;
+ }
+
+ @Override
+ public int readUtf8CodePoint() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public String readString(Charset charset) throws IOException {
+ return null;
+ }
+
+ @Override
+ public String readString(long l, Charset charset) throws IOException {
+ return null;
+ }
+
+ @Override
+ public long indexOf(byte b) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long indexOf(byte b, long l) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long indexOf(byte b, long l, long l1) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long indexOf(ByteString byteString) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long indexOf(ByteString byteString, long l) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long indexOfElement(ByteString byteString) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public long indexOfElement(ByteString byteString, long l) throws IOException {
+ return 0;
+ }
+
+ @Override
+ public boolean rangeEquals(long l, ByteString byteString) throws IOException {
+ return false;
+ }
+
+ @Override
+ public boolean rangeEquals(long l, ByteString byteString, int i, int i1) throws IOException {
+ return false;
+ }
+
+ @Override
+ public InputStream inputStream() {
+ return null;
+ }
+ };
+ return bufferedSource;
+ }
+ };
+ return retrofit2.Response.success(200,responseBody);
+ }
+
+ @Override
+ public void enqueue(Callback<ResponseBody> callback) {
+
+ }
+
+ @Override
+ public boolean isExecuted() {
+ return false;
+ }
+
+ @Override
+ public void cancel() {
+
+ }
+
+ @Override
+ public boolean isCanceled() {
+ return false;
+ }
+
+ @Override
+ public Call<ResponseBody> clone() {
+ return null;
+ }
+
+ @Override
+ public Request request() {
+ return null;
+ }
+ };
+ return call;
+ }