GithubHelp home page GithubHelp logo

hanleyt / jersey-junit Goto Github PK

View Code? Open in Web Editor NEW
16.0 5.0 6.0 148 KB

A JUnit 5 extension for testing JAX-RS and Jersey-based applications using the Jersey test framework.

License: Apache License 2.0

Java 87.41% Kotlin 12.59%

jersey-junit's People

Contributors

grunenwflorian avatar hanleyt avatar lordjaxom avatar rmcdouga avatar snago avatar tomashanley-toast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jersey-junit's Issues

Add the ability to configure Jersey Client

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.

Update to jersey 3.0.1

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

Deploy to Maven Central

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.

gradle not able to resolve jersey-unit:1.0.1

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.

URI set to localhost:0 when a random port is used.

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.

Bumping jersey version to 2.28

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,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.