hanleyt / jersey-junit Goto Github PK
View Code? Open in Web Editor NEWA JUnit 5 extension for testing JAX-RS and Jersey-based applications using the Jersey test framework.
License: Apache License 2.0
A JUnit 5 extension for testing JAX-RS and Jersey-based applications using the Jersey test framework.
License: Apache License 2.0
Hello Tomas,
First of all, thanks for this extension... it has helped us a lot in our unit testing.
Do you have any plans to update to jersey 3 and thus switching to jakarta packages? I know this would be a major release, im wondering if you're are planning to do this, since we are updating our dependencies and doing the same thing on our side.
Thanks
Omar
JerseyTest provides the hook for configuring advanced client settings by overriding the configureClient method of JerseyTest. It would be nice if a test using JerseyExtension could provide an updated ClientConfig.
I've forked your project and made the changes to the JerseyExtension class. The code is relatively trivial.
P.S. Thanks for writing this and making it available.
Hey Tomas,
First, thanks for the library !
Second, would it be possible to upgrade the jersey version to 2.28 and release it ?
2.28 was released by the eclipse foundation and contains some bug fixes.
Regards,
I have to configure the client in order to register the MultiPartBeanProvider.class. I can see that this issue is closed but at the moment gradle is "Unable to resolve com.github.hanley:jersey-unit:1.0.1". It can only resolve 1.0.0 witch does not provide client configuration features. For the moment the only way that I can get pass this problem is by installing the artifacts in the local maven cache.
Could you deploy the Maven artifacts also to Maven Central? This will simply the usage a lot, if you have to use a very strict company proxy.
Hey Tomas,
Whenever we use the Jersey Extension to create a server using a random port (by setting "jersey.config.test.container.port" to "0" by example) the URI injected is set to "http://localhost:0".
The reason is that the URI object is added to the store before starting the server.
@Override
protected Application configure() {
getStore(context).put(URI.class, getBaseUri());
return applicationProvider.apply(context);
}
I think moving that here :
@Override
public void beforeEach(ExtensionContext context) throws Exception {
JerseyTest jerseyTest = initJerseyTest(context);
// added
getStore(context).put(URI.class, jerseyTest.target().getUri());
//
getStore(context).put(Client.class, jerseyTest.client());
getStore(context).put(WebTarget.class, jerseyTest.target());
}
will fix it.
On an unrelated note :
Would you consider removing the jersey-test-framework-provider-grizzly2 dependency ?
That would allow us to pick the type of provider more easily. Currently we are considering the jetty one.
If you are okay with one of those changes I'd gladly create a PR, just le me know.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.