bastion-dev / Bastion

Java test library for HTTP APIs
http://bastion.rocks
GNU General Public License v3.0
13 stars 8 forks source link

Make JsonSchemaAssertions check for JSON content-type #65

Closed mariacamenzuli closed 7 years ago

mariacamenzuli commented 7 years ago

Added assertions on the response content type in JsonSchemaAssertions.

This fixes #59

mariacamenzuli commented 7 years ago

This change was simply copying the assertions on the content type from JsonResponseAssertions over to JsonSchemaAssertions. Can we come up with some kind of abstraction for the capabilities of the assertion classes to avoid this duplication? @FrelliBB @KPull

KPull commented 7 years ago

Can we come up with some kind of abstraction for the capabilities of the assertion classes to avoid this duplication?

Yes. I can forsee that an Assertions object would typically want to assert the status code and content-type for example. We can abstract this into a CommonAssertions object (just like we have CommonRequestAttributes), and have the applicable assertions inherit from CommonAssertions by composition.

mariacamenzuli commented 7 years ago

I think it's best if we refactor the structure of the assertions in a separate pull request. I can open an issue.

mariacamenzuli commented 7 years ago

I've applied the other changes requested.

mariacamenzuli commented 7 years ago

Opened #66 for the assertion abstraction task.