Why are my tests not triggering my filter?

Why are my tests not triggering my filter?

I have following Problem. My tests are running allways positive even when the HttpHeaders.AUTHORIZATION headder has a wrong token. In theory it should fail because I have a filter that checks the token. My Jax-RS program is working perfectly in the browser or using a httpclient like postman. So I have to generate a token first and then use that token to run the HTTP commands otherwise it will return the statuscode 401. I think that my configuration is wrong and the Testframework is running the tests without triggering the filter. I never worked with Jax-RS before and I have no Idea how to fix that...

I have following Problem. My tests are running allways positive even when the HttpHeaders.AUTHORIZATION headder has a wrong token. In theory it should fail because I have a filter that checks the token. My Jax-RS program is working perfectly in the browser or using a httpclient like postman. So I have to generate a token first and then use that token to run the HTTP commands otherwise it will return the statuscode 401. I think that my configuration is wrong and the Testframework is running the tests without triggering the filter. I never worked with Jax-RS before and I have no Idea how to fix that...

public class GamesTest extends JerseyTest{


@Override protected Application configure() { return new ResourceConfig(Games.class).register(new AbstractBinder() { protected void configure() { bind(GamesXMLDB.class).to(MyGameDBInterfaceDB.class).in(Singleton.class); bind(UserXMLDB.class).to(MyUserInterfaceDB.class).in(Singleton.class); } }); }

@Test public void getWithoutTokenTest() { Response response = target("/games").request().header(HttpHeaders.AUTHORIZATION, "").get(); assertEquals(200, response.getStatus()); }


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

Fundamentos de Java: Aprende Java desde cero, sin misterios | Simpliv

Fundamentos de Java: Aprende Java desde cero, sin misterios