You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Switch to using the Java HTTP client
There are 2 reasons to make that change:
1. reduce the number of dependencies of the client, in order to
remove the dependency on Netty
2. the JDK HTTP client doesn't need to be closed
The 2d point deserves a bit more information. The test resources
client factory is called by the test resources client, and in
general, there should be at most a couple calls per build. In
practice, this isn't the case: in Micronaut Data for example,
there are many calls because tests spawn their own application
context.
One issue is that Micronaut Core will _not_ call `#close` on
a `PropertySourceLoader` once an application context is closed,
even if that loader implements `Closeable`. It is arguable if
it's a bug or not, but in practice, it means that there is no
way for Micronaut Test Resources to proactively close a client.
Switching to the JDK HTTP Client solves this problem because
there is no need to call the close method anymore.
This PR doesn't change the communication protocol between
the client and the server because core lacks some support
to make it easily possible. The consequence is that we're
still adding a dependency on `micronaut-json-core`, which
also means that if there's no JSON mapper on classpath
(either Jackson or Serde), then test resources won't work.
I am unsure but I think that was already the case before,
even with the dependency on HTTP Netty, unless that was
bringing a mapper on classpath transparently.
* Fix client String decoding
Copy file name to clipboardExpand all lines: test-resources-client/src/main/java/io/micronaut/testresources/client/TestResourcesClientPropertyExpressionResolver.java
0 commit comments