Skip to content

Commit

Permalink
remove bug related todos
Browse files Browse the repository at this point in the history
created issues for that:
- citrusframework#1190
- citrusframework#1189
  • Loading branch information
Sterchi Daniel committed Jul 17, 2024
1 parent 5836a12 commit 2e65e2c
Showing 1 changed file with 0 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,119 +188,6 @@ public void getPetById_generated() {
.receive("getPetById", HttpStatus.OK));
}

// TODO TAT-1291 create issues for Bugs
@CitrusTest
public void BUG_getPetById_paramsCanAlsoBeSetWithMessageBuilder() {
variable("petId", "1001");

when(openapi(petstoreSpec)
.client(httpClient)
.send("getPetById")
.fork(true)
.message()
// TODO Bug - if the params are already set on the message, they get overwritten
.queryParam("verbose", "false")
.header("correlationIds", "1234F5gXW")
);

then(http().server(httpServer)
.receive()
.get("/pet/1001")
.queryParam("verbose", "true")
.message()
.header("correlationIds", "1234F5gXW")
);

then(http().server(httpServer)
.send()
.response(HttpStatus.OK)
.message()
.body(Resources.create("classpath:org/citrusframework/openapi/petstore/pet.json"))
.contentType("application/json"));

then(openapi(petstoreSpec)
.client(httpClient)
.receive("getPetById", HttpStatus.OK));
}

@CitrusTest
public void BUG_should_be_possible_to_switch_content_type__to_xml() {
variable("petId", "1001");

when(openapi(petstoreSpec)
.client(httpClient)
.send("getPetById")
.message()
.accept("application/xml")
.fork(true));

then(http().server(httpServer)
.receive()
.get("/pet/${petId}")
.message()
.accept("@contains('application/xml')@"));

then(http().server(httpServer)
.send()
.response(HttpStatus.OK)
.message()
.body(Resources.create("classpath:org/citrusframework/openapi/petstore/pet.xml"))
.contentType("application/xml"));

then(openapi(petstoreSpec)
.client(httpClient)
.receive("getPetById", HttpStatus.OK)
.message()
// TODO BUG XML bodies do not seem to work, even if there is just XML as "produces" in the spec
.body(Resources.create("classpath:org/citrusframework/openapi/petstore/pet.xml"))
// TODO BUG the type/contentType statements are useless, if there is another type in the spec.
// even if there are two. i.E:
// # this will always use JSON as type
// produces:
// - application/json
// - application/xml
.contentType("application/xml")
.type(XML));
}

@CitrusTest
public void BUG_should_only_validate_the_presence_of_required_properties() {
variable("petId", "1001");

when(openapi(petstoreSpec)
.client(httpClient)
.send("getPetById")
.message()
.accept("application/json")
.fork(true));

then(http().server(httpServer)
.receive()
.get("/pet/${petId}")
.message()
.accept("@contains('application/json')@"));

then(http().server(httpServer)
.send()
.response(HttpStatus.OK)
.message()
// TODO BUG this should be valid, according to the spec-file
.body("""
{
"category": {},
"name": "",
"status": "sold"
}
""")
.contentType("application/json"));

then(openapi(petstoreSpec)
.client(httpClient)
.receive("getPetById", HttpStatus.OK)
.message()
);
}

@CitrusTest
public void postAddPet() {
variable("petId", "1001");
Expand Down

0 comments on commit 2e65e2c

Please sign in to comment.