test_class.declarator: servletContext
test_class.modifier: private
test_class.original_string: private ServletContextImpl servletContext;
test_class.type: ServletContextImpl
test_class.var_name: servletContext
test_class.declarator: servletContextHelper = new ServletContextHelper()
test_class.modifier: private
test_class.original_string: private ServletContextHelper servletContextHelper = new ServletContextHelper();
test_class.type: ServletContextHelper
test_class.var_name: servletContextHelper
test_class.file: http/src/test/java/ro/polak/http/servlet/helper/ServletContextHelperTest.java
test_class.identifier: ServletContextHelperTest
test_case.body: @Test
      public void shouldReturnFilteredFiltersWithExclude() {
          List<FilterMapping> filterMappings = new ArrayList<>();
          filterMappings.add(new FilterMappingImpl(Pattern.compile("^/secured/.*$"), null, FakeAbstractFilter.class));
          filterMappings.add(new FilterMappingImpl(Pattern.compile("^/secured/abc.*$"),
                  Pattern.compile("^/secured/abc/exclude.*$"), FakeAbstractFilter.class));
          filterMappings.add(new FilterMappingImpl(Pattern.compile("^/demo/.*$"), null, FakeAbstractFilter.class));
          when(servletContext.getFilterMappings()).thenReturn(filterMappings);
          assertThat(servletContextHelper.getFilterMappingsForPath(servletContext, "/context/secured/abc/excluded"),
                  hasSize(1));
      }
test_case.class_method_signature: ServletContextHelperTest.shouldReturnFilteredFiltersWithExclude()
test_case.full_signature: @Test public void shouldReturnFilteredFiltersWithExclude()
test_case.identifier: shouldReturnFilteredFiltersWithExclude
test_case.invocations: add compile add compile compile add compile thenReturn when getFilterMappings assertThat getFilterMappingsForPath hasSize
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReturnFilteredFiltersWithExclude()
focal_class.file: http/src/main/java/ro/polak/http/servlet/helper/ServletContextHelper.java
focal_class.identifier: ServletContextHelper
focal_class.class_method_signature: ServletContextHelper.getResolvedServletMapping(final ServletContext servletContext, final String path)
focal_class.full_signature: public ServletMapping getResolvedServletMapping(final ServletContext servletContext, final String path)
focal_class.identifier: getResolvedServletMapping
focal_class.modifiers: public
focal_class.parameters: (final ServletContext servletContext, final String path)
focal_class.return: ServletMapping
focal_class.signature: ServletMapping getResolvedServletMapping(final ServletContext servletContext, final String path)
focal_class.class_method_signature: ServletContextHelper.getResolvedContext(final List<ServletContextImpl> servletContexts, final String path)
focal_class.full_signature: public ServletContextImpl getResolvedContext(final List<ServletContextImpl> servletContexts, final String path)
focal_class.identifier: getResolvedContext
focal_class.modifiers: public
focal_class.parameters: (final List<ServletContextImpl> servletContexts, final String path)
focal_class.return: ServletContextImpl
focal_class.signature: ServletContextImpl getResolvedContext(final List<ServletContextImpl> servletContexts, final String path)
focal_class.class_method_signature: ServletContextHelper.getFilterMappingsForPath(final ServletContext servletContext, final String path)
focal_class.full_signature: public List<FilterMapping> getFilterMappingsForPath(final ServletContext servletContext, final String path)
focal_class.identifier: getFilterMappingsForPath
focal_class.modifiers: public
focal_class.parameters: (final ServletContext servletContext, final String path)
focal_class.return: List<FilterMapping>
focal_class.signature: List<FilterMapping> getFilterMappingsForPath(final ServletContext servletContext, final String path)
focal_class.class_method_signature: ServletContextHelper.getPathInContext(final ServletContext servletContext, final String path)
focal_class.full_signature: private String getPathInContext(final ServletContext servletContext, final String path)
focal_class.identifier: getPathInContext
focal_class.modifiers: private
focal_class.parameters: (final ServletContext servletContext, final String path)
focal_class.return: String
focal_class.signature: String getPathInContext(final ServletContext servletContext, final String path)
focal_method.body: public List<FilterMapping> getFilterMappingsForPath(final ServletContext servletContext, final String path) {
          Objects.requireNonNull(servletContext);
          String inContextPath = getPathInContext(servletContext, path);
  
          List<FilterMapping> filterMappings = new ArrayList<>();
          for (FilterMapping filterMapping : servletContext.getFilterMappings()) {
              if (filterMapping.getUrlPattern().matcher(inContextPath).matches()) {
                  if (filterMapping.getUrlExcludePattern() != null) {
                      if (!filterMapping.getUrlExcludePattern().matcher(inContextPath).matches()) {
                          filterMappings.add(filterMapping);
                      }
                  } else {
                      filterMappings.add(filterMapping);
                  }
              }
          }
  
          return filterMappings;
      }
focal_method.class_method_signature: ServletContextHelper.getFilterMappingsForPath(final ServletContext servletContext, final String path)
focal_method.full_signature: public List<FilterMapping> getFilterMappingsForPath(final ServletContext servletContext, final String path)
focal_method.identifier: getFilterMappingsForPath
focal_method.invocations: requireNonNull getPathInContext getFilterMappings matches matcher getUrlPattern getUrlExcludePattern matches matcher getUrlExcludePattern add add
focal_method.modifiers: public
focal_method.parameters: (final ServletContext servletContext, final String path)
focal_method.return: List<FilterMapping>
focal_method.signature: List<FilterMapping> getFilterMappingsForPath(final ServletContext servletContext, final String path)