Files had various formatting differences, as did pull requests. Rather than
create our own style, this inherits and requires the well documented Google
Java Style.
Feign 8.x will no longer support Dagger, nor interfaces annotated with `javax.inject.@Named`. Users must migrate from `javax.inject.@Named` to `feign.@Param` via Feign v7.1+ before attempting to update to Feign 8.0.
For example, the following uses `@Param` as opposed to `@Named` to annotate template parameters.
```java
interface GitHub {
@RequestLine("GET /repos/{owner}/{repo}/contributors")
List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);
}
```
AssertJ has more powerful test assertions and does not run the risk of
interfering with the classpath of main code, such as guava does. This
removes guava from test and example code and adjusts using AssertJ in
some cases.
JUnit Rules, such as MockWebServerRule, reduce boilerplate setup present
in our tests. By migrating off TestNG, and onto rules, our tests become
more maintainable as JUnit is well understood.
Request/Response/RequestTemplate are now fundamentally based on a byte[] body field.
For Request/RequestTemplate, if a charset is provided, it can be treated as text.
For many users of the library, the change should barely be noticeable, as the methods that
were changed were mostly used internally.
There were some non-backwards-compatible signature changes that require a
major version bump, however.
The logic in GsonCodec was split into GsonEncoder and GsonDecoder, each of which can
now be used separately. GsonCodec was deprecated, and can be removed in the next major
version. To facilitate use outside of Dagger, the double-to-int map type adapter was broken into
its own class, and is included by default when using the default constructors of either the
encoder or decoder. The examples have been updated to use the new encoder/decoder instead
of the codec.
This is intended as a step towards simplifying Feign.
This changeset removes the generics from both interfaces, and changes their
Dagger bindings from SET to UNIQUE.
Additionally, in changing the signatures for Encoder/Decoder, it focuses on use
of the RequestTemplate and Response objects, allowing us to extend them
in the future to support binary data without needing to change the
Encoder/Decoder signatures again.