### Question:
PetApi { public void deletePet(Long petId, String apiKey) throws ApiException { deletePetWithHttpInfo(petId, apiKey); } PetApi();  PetApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); okhttp3.Call addPetCall(Pet body, final ApiCallback _callback); void addPet(Pet body); ApiResponse<Void> addPetWithHttpInfo(Pet body); okhttp3.Call addPetAsync(Pet body, final ApiCallback<Void> _callback); okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback); void deletePet(Long petId, String apiKey); ApiResponse<Void> deletePetWithHttpInfo(Long petId, String apiKey); okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback<Void> _callback); okhttp3.Call findPetsByStatusCall(List<String> status, final ApiCallback _callback); List<Pet> findPetsByStatus(List<String> status); ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status); okhttp3.Call findPetsByStatusAsync(List<String> status, final ApiCallback<List<Pet>> _callback); @Deprecated okhttp3.Call findPetsByTagsCall(Set<String> tags, final ApiCallback _callback); @Deprecated Set<Pet> findPetsByTags(Set<String> tags); @Deprecated ApiResponse<Set<Pet>> findPetsByTagsWithHttpInfo(Set<String> tags); @Deprecated okhttp3.Call findPetsByTagsAsync(Set<String> tags, final ApiCallback<Set<Pet>> _callback); okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback); Pet getPetById(Long petId); ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId); okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback<Pet> _callback); okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback); void updatePet(Pet body); ApiResponse<Void> updatePetWithHttpInfo(Pet body); okhttp3.Call updatePetAsync(Pet body, final ApiCallback<Void> _callback); okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback); void updatePetWithForm(Long petId, String name, String status); ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status); okhttp3.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback<Void> _callback); okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback); ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file); ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file); okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback<ModelApiResponse> _callback); okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback); ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata); ApiResponse<ModelApiResponse> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata); okhttp3.Call uploadFileWithRequiredFileAsync(Long petId, File requiredFile, String additionalMetadata, final ApiCallback<ModelApiResponse> _callback);  }### Answer:
@Test public void deletePetTest() throws ApiException { Long petId = null; String apiKey = null; api.deletePet(petId, apiKey); }
@Test public void testDeletePet() throws Exception { Pet pet = createPet(); api.addPet(pet); Pet fetched = api.getPetById(pet.getId()); api.deletePet(pet.getId(), null); try { fetched = api.getPetById(fetched.getId()); fail("expected an error"); } catch (ApiException e) { LOG.info("Code: {}. Message: {}", e.getCode(), e.getMessage()); assertEquals(404, e.getCode()); } }