bastion-dev / Bastion

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

Problem with ambiguous StatusCodeAssertions.expecting() method #64

Closed KPull closed 7 years ago

KPull commented 7 years ago

There's a problem with StatusCodeAssertions.expecting() method which is causing compiler errors when users pass in integer literals directly to StatusCodeAssertions.expecting().

When this happens, compilation fails because there are two ambiguous expecting() methods: one which takes Integer objects and one which takes int primitives. The initial tests didn't catch this because in StatusCodeAssertionsTest I had wrapped some repeated code into a method testAssertion() which takes int primitives: this would resolve the ambiguity for the compiler.

However, we can't expect users to do what I did in the test; most of the time, users will supply literals directly into the method. We have to resolve this issue by removing one of the ambiguous expecting() methods.

P.S.: We have to resolve this before we can release Bastion version 1.0 for sure because this will require public API changes.

KPull commented 7 years ago

Fixed by @dagre in #67.