    @Test
    public void testProxyDefaultWhitelistLimitedWhenSecure() throws Exception {

        SecurityDispatcher secDisp = mock(SecurityDispatcher.class);
        when(secDisp.isSecurityEnabled()).thenReturn(true);

        GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class);
        when(gwcd.getServletPrefix()).thenReturn(null);

        service = new WMSService(sb, tld, mock(RuntimeStats.class), new NullURLMangler(), gwcd);
        service.setSecurityDispatcher(secDisp);

        String layerName = "mockLayer";
        TestLayer tileLayer = mock(TestLayer.class);
        when(tld.getTileLayer(layerName)).thenReturn(tileLayer);

        testProxyRequestPrevented(secDisp, layerName, tileLayer, "TROZ");
    }