@Test public void getAddNicrequestBody() throws JsonProcessingException { final String requestBody = AddNicBody(nutanixNicInputs); assertEquals(EXPECTED_ADD_NIC_REQUEST_BODY, requestBody); }
@NotNull public static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs) { String requestBody = EMPTY; ObjectMapper AttachNicMapper = new ObjectMapper(); AddNicRequestBody AddNicBody = new AddNicRequestBody(); ArrayList spec_list = new ArrayList(); String[] network_uuid = nutanixAttachNicInputs.getNetworkUUID().split(","); String[] requested_ip_address = nutanixAttachNicInputs.getRequestedIPAddress().split(","); String[] is_connected = nutanixAttachNicInputs.getIsConnected().split(","); String[] vlan_Id = nutanixAttachNicInputs.getVlanid().split(","); if (requested_ip_address.length == is_connected.length && requested_ip_address.length == vlan_Id.length) { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); vmNics.setIs_connected(Boolean.parseBoolean(is_connected[i])); vmNics.setVlan_id(vlan_Id[i]); spec_list.add(vmNics); } } else { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); spec_list.add(vmNics); } } AddNicBody.setSpec_list(spec_list); try { requestBody = AttachNicMapper.writeValueAsString(AddNicBody); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }
NicImpl { @NotNull public static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs) { String requestBody = EMPTY; ObjectMapper AttachNicMapper = new ObjectMapper(); AddNicRequestBody AddNicBody = new AddNicRequestBody(); ArrayList spec_list = new ArrayList(); String[] network_uuid = nutanixAttachNicInputs.getNetworkUUID().split(","); String[] requested_ip_address = nutanixAttachNicInputs.getRequestedIPAddress().split(","); String[] is_connected = nutanixAttachNicInputs.getIsConnected().split(","); String[] vlan_Id = nutanixAttachNicInputs.getVlanid().split(","); if (requested_ip_address.length == is_connected.length && requested_ip_address.length == vlan_Id.length) { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); vmNics.setIs_connected(Boolean.parseBoolean(is_connected[i])); vmNics.setVlan_id(vlan_Id[i]); spec_list.add(vmNics); } } else { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); spec_list.add(vmNics); } } AddNicBody.setSpec_list(spec_list); try { requestBody = AttachNicMapper.writeValueAsString(AddNicBody); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; } }
NicImpl { @NotNull public static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs) { String requestBody = EMPTY; ObjectMapper AttachNicMapper = new ObjectMapper(); AddNicRequestBody AddNicBody = new AddNicRequestBody(); ArrayList spec_list = new ArrayList(); String[] network_uuid = nutanixAttachNicInputs.getNetworkUUID().split(","); String[] requested_ip_address = nutanixAttachNicInputs.getRequestedIPAddress().split(","); String[] is_connected = nutanixAttachNicInputs.getIsConnected().split(","); String[] vlan_Id = nutanixAttachNicInputs.getVlanid().split(","); if (requested_ip_address.length == is_connected.length && requested_ip_address.length == vlan_Id.length) { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); vmNics.setIs_connected(Boolean.parseBoolean(is_connected[i])); vmNics.setVlan_id(vlan_Id[i]); spec_list.add(vmNics); } } else { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); spec_list.add(vmNics); } } AddNicBody.setSpec_list(spec_list); try { requestBody = AttachNicMapper.writeValueAsString(AddNicBody); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }  }
NicImpl { @NotNull public static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs) { String requestBody = EMPTY; ObjectMapper AttachNicMapper = new ObjectMapper(); AddNicRequestBody AddNicBody = new AddNicRequestBody(); ArrayList spec_list = new ArrayList(); String[] network_uuid = nutanixAttachNicInputs.getNetworkUUID().split(","); String[] requested_ip_address = nutanixAttachNicInputs.getRequestedIPAddress().split(","); String[] is_connected = nutanixAttachNicInputs.getIsConnected().split(","); String[] vlan_Id = nutanixAttachNicInputs.getVlanid().split(","); if (requested_ip_address.length == is_connected.length && requested_ip_address.length == vlan_Id.length) { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); vmNics.setIs_connected(Boolean.parseBoolean(is_connected[i])); vmNics.setVlan_id(vlan_Id[i]); spec_list.add(vmNics); } } else { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); spec_list.add(vmNics); } } AddNicBody.setSpec_list(spec_list); try { requestBody = AttachNicMapper.writeValueAsString(AddNicBody); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }  static Map<String, String> AddNic(@NotNull final NutanixAddNicInputs nutanixAddNicInputs); @NotNull static Map<String, String> deleteNic(@NotNull final NutanixDeleteNICInputs nutanixDeleteNICInputs); @NotNull static String AddNicURL(NutanixAddNicInputs nutanixAttachNicInputs); @NotNull static String deleteNicURL(NutanixDeleteNICInputs nutanixDeleteNICInputs); @NotNull static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs); }
NicImpl { @NotNull public static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs) { String requestBody = EMPTY; ObjectMapper AttachNicMapper = new ObjectMapper(); AddNicRequestBody AddNicBody = new AddNicRequestBody(); ArrayList spec_list = new ArrayList(); String[] network_uuid = nutanixAttachNicInputs.getNetworkUUID().split(","); String[] requested_ip_address = nutanixAttachNicInputs.getRequestedIPAddress().split(","); String[] is_connected = nutanixAttachNicInputs.getIsConnected().split(","); String[] vlan_Id = nutanixAttachNicInputs.getVlanid().split(","); if (requested_ip_address.length == is_connected.length && requested_ip_address.length == vlan_Id.length) { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); vmNics.setIs_connected(Boolean.parseBoolean(is_connected[i])); vmNics.setVlan_id(vlan_Id[i]); spec_list.add(vmNics); } } else { for (int i = 0; i < requested_ip_address.length; i++) { AddNicRequestBody.VMNics vmNics = AddNicBody.new VMNics(); vmNics.setNetwork_uuid(network_uuid[i]); vmNics.setRequested_ip_address(requested_ip_address[i]); spec_list.add(vmNics); } } AddNicBody.setSpec_list(spec_list); try { requestBody = AttachNicMapper.writeValueAsString(AddNicBody); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }  static Map<String, String> AddNic(@NotNull final NutanixAddNicInputs nutanixAddNicInputs); @NotNull static Map<String, String> deleteNic(@NotNull final NutanixDeleteNICInputs nutanixDeleteNICInputs); @NotNull static String AddNicURL(NutanixAddNicInputs nutanixAttachNicInputs); @NotNull static String deleteNicURL(NutanixDeleteNICInputs nutanixDeleteNICInputs); @NotNull static String AddNicBody(NutanixAddNicInputs nutanixAttachNicInputs);  }