The point is to make call to service and collect all taxonomies id and no matter where to store them(Could be session or maybe java List. For now storing it in session because didnt find a way to store in java list). And then based on this id execute another call to delete this taxonomies by it's id "services/taxonomy-package/{taxonomyId}". Don't know how to execute a second point properly Long story short. 1: get all taxonomies -> save all id's to session 2: iterate over id's -> delete them
Here is my code
ScenarioBuilder init = scenario("Initialization")
.exec(http("getAllTaxonomies")
.get("/services/taxonomy-packages")
.check(jsonPath("$..id")
.findAll().saveAs("taxonomyIDs")))
// and here problems starts
.foreach("${taxonomyIDs}", "id")
.on(exec(http("deleteTaxonomy")
.delete("/services/taxonomy-packages/#{taxonomyIDs}")
.check(status().is(204))));