Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Добавить pet в магазин
- List<String> photoUrls = new ArrayList<>();
- photoUrls.add("www.test.com");
- TagsItem tag = new TagsItem()
- .id(Integer.parseInt(faker.number().digits(5)))
- .name(petName);
- List<TagsItem> tags = new ArrayList<>();
- tags.add(tag);
- AddPetToStore payload = new AddPetToStore()
- .category(new Category())
- .name(petType)
- .photoUrls(photoUrls)
- .tags(tags)
- .status("available");
- apiService.addPetToStore(payload);
- // request:
- {
- "id": 9223127516080517488,
- "category": {
- "id": 0
- },
- "name": "turtle ",
- "photoUrls": [
- "www.test.com"
- ],
- "tags": [
- {
- "id": 37225,
- "name": "Lyle"
- }
- ],
- "status": "available"
- }
- ================================================================================
- // обновить pet
- List<String> photoUrls = new ArrayList<>();
- photoUrls.add("https://someURL.com");
- AddPetToStore payload = new AddPetToStore()
- .id((int) petId)
- .photoUrls(photoUrls);
- apiService.updatePet(payload);
- // request:
- {
- "photoUrls": [
- "https://someURL.com"
- ],
- "name": null,
- "id": 303837552,
- "category": null,
- "tags": null,
- "status": null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement