users@jersey.java.net

[Jersey] InMemoryTestContainer is overwriting PROPERTY_CONTAINER_REQUEST_FILTERS

From: Cemo <cemalettin.koc_at_gmail.com>
Date: Mon, 27 Aug 2012 09:55:13 +0300

Hi,

It seems a bug for me but I could not be sure without
asking. InMemoryTestContainer has InMemoryTestContainer private method but
it looks like it is overwriting PROPERTY_CONTAINER_REQUEST_FILTERS which
are already set.

I am trying to figure out how to write a custom SecurityFilter but
my PROPERTY_CONTAINER_REQUEST_FILTERS are overwritten by container. Any
help please?

Thanks





com.sun.jersey.test.framework.spi.container.inmemory.InMemoryTestContainerFactory.InMemoryTestContainer#InMemoryTestContainer


       private InMemoryTestContainer(URI baseUri, LowLevelAppDescriptor ad)
{
            this.baseUri = UriBuilder.fromUri(baseUri).build();

            LOGGER.info("Creating low level InMemory test container
configured at the base URI "
                    + this.baseUri);

            this.resourceConfig = ad.getResourceConfig();
            this.resourceConfig.getProperties()
                    .put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,
LoggingFilter.class.getName());
            this.resourceConfig.getProperties()

.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS,
LoggingFilter.class.getName());
            this.webApp = initiateWebApplication(resourceConfig);
        }