@Test public void testUploadFile() throws Exception { Pet pet = createRandomPet(); api.addPet(pet); File file = new File("hello.txt"); BufferedWriter writer = new BufferedWriter(new FileWriter(file)); writer.write("Hello world!"); writer.close(); api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); }