eclipse-ee4j / eclipse-ee4j/jersey
JerseyTest: ServletDeploymentContext.addFilter() has no effect
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
I have the following test class:
```
**MyTest.java**public class MyTest extends JerseyTest {
@Override
protected DeploymentContext configureDeployment() {
return ServletDeploymentContext.builder(configure()).addFilter(SomeFilter.class, "SomeFilterName").build();
}
}
```
Plus the following filter
```
**SomeFilter.java**public class SomeFilter implements Filter {
public void init(FilterConfig filterConfig) {
}
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
filterChain.doFilter(servletRequest, servletResponse);
}
public void destroy() {
}
}
```
If been looking through the code and couldn't find any place where the fitler I added would be read. I would have expected it to be read in GrizzlyTestContainerFactory#GrizzlyTestContainer, JettyTestContainerFactory#JettyTestContainer or InMemoryTestContainerFactory#InMemoryTestContainer.
Looks like this feature was not used so far and is not implemented yet.
#### Affected Versions
[2.22.1]
Contributor guide
Assessment
This issue has not been assessed yet.