Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output HTTP responses with Jersey Test Framework?

Can the Jersey Test Framework be configured to output the raw HTTP responses when a test case fails? I'd like to be able to see the detailed error information returned by the server.

like image 773
HolySamosa Avatar asked May 24 '26 05:05

HolySamosa


1 Answers

You can enable HTTP logging like so

public class SimpleTest extends JerseyTest {
    // ...

    @Override
    protected Application configure() {
        enable(TestProperties.LOG_TRAFFIC);
        enable(TestProperties.DUMP_ENTITY);
        // ...
    }
}

More details here.

This is for the latest version of the framework, currently 2.3.1.

like image 134
Paul D. Eden Avatar answered May 26 '26 22:05

Paul D. Eden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!