test_class.file: restx-core/src/test/java/restx/specs/RestxSpecRepositoryTest.java
test_class.identifier: RestxSpecRepositoryTest
test_case.body: @Test
      public void should_find_specs_for_operation() throws Exception {
          RestxSpecRepository resource = getRestxSpecRepository();
  
          ImmutableMap<String, RestxSpec> allSpecs = ImmutableMap.of(
                  "cases/test/test.spec.yaml", spec("should say hello on path", when("GET", "/messages/xavier")),
                  "cases/test/test2.spec.yaml", spec("should say hello w/ query param", when("GET", "/messages?who=xavier")));
  
          assertThat(resource.filterSpecsByOperation(allSpecs, "GET", "/messages/{id}"))
                  .isNotEmpty().containsExactly("cases/test/test.spec.yaml");
          assertThat(resource.filterSpecsByOperation(allSpecs, "GET", "/messages"))
                  .isNotEmpty().containsExactly("cases/test/test2.spec.yaml");
      }
test_case.class_method_signature: RestxSpecRepositoryTest.should_find_specs_for_operation()
test_case.full_signature: @Test public void should_find_specs_for_operation()
test_case.identifier: should_find_specs_for_operation
test_case.invocations: getRestxSpecRepository of spec when spec when containsExactly isNotEmpty assertThat filterSpecsByOperation containsExactly isNotEmpty assertThat filterSpecsByOperation
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_find_specs_for_operation()
focal_class.declarator: logger = LoggerFactory.getLogger(RestxSpecRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(RestxSpecRepository.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: allSpecs
focal_class.modifier: private
focal_class.original_string: private ImmutableMap<String, RestxSpec> allSpecs;
focal_class.type: ImmutableMap<String, RestxSpec>
focal_class.var_name: allSpecs
focal_class.declarator: specLoader
focal_class.modifier: private
focal_class.original_string: private RestxSpecLoader specLoader;
focal_class.type: RestxSpecLoader
focal_class.var_name: specLoader
focal_class.file: restx-core/src/main/java/restx/specs/RestxSpecRepository.java
focal_class.identifier: RestxSpecRepository
focal_class.class_method_signature: RestxSpecRepository.RestxSpecRepository(RestxSpecLoader specLoader)
focal_class.full_signature: public  RestxSpecRepository(RestxSpecLoader specLoader)
focal_class.identifier: RestxSpecRepository
focal_class.modifiers: public
focal_class.parameters: (RestxSpecLoader specLoader)
focal_class.signature:  RestxSpecRepository(RestxSpecLoader specLoader)
focal_class.class_method_signature: RestxSpecRepository.findAll()
focal_class.full_signature: public Iterable<String> findAll()
focal_class.identifier: findAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> findAll()
focal_class.class_method_signature: RestxSpecRepository.findSpecById(String id)
focal_class.full_signature: public Optional<RestxSpec> findSpecById(String id)
focal_class.identifier: findSpecById
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: Optional<RestxSpec>
focal_class.signature: Optional<RestxSpec> findSpecById(String id)
focal_class.class_method_signature: RestxSpecRepository.findSpecsByOperation(String httpMethod, String path)
focal_class.full_signature: public Iterable<String> findSpecsByOperation(String httpMethod, String path)
focal_class.identifier: findSpecsByOperation
focal_class.modifiers: public
focal_class.parameters: (String httpMethod, String path)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> findSpecsByOperation(String httpMethod, String path)
focal_class.class_method_signature: RestxSpecRepository.findSpecsByRequest(RestxRequest request)
focal_class.full_signature: public Iterable<WhenHttpRequest> findSpecsByRequest(RestxRequest request)
focal_class.identifier: findSpecsByRequest
focal_class.modifiers: public
focal_class.parameters: (RestxRequest request)
focal_class.return: Iterable<WhenHttpRequest>
focal_class.signature: Iterable<WhenHttpRequest> findSpecsByRequest(RestxRequest request)
focal_class.class_method_signature: RestxSpecRepository.findAllSpecs()
focal_class.full_signature: synchronized ImmutableMap<String, RestxSpec> findAllSpecs()
focal_class.identifier: findAllSpecs
focal_class.modifiers: synchronized
focal_class.parameters: ()
focal_class.return: ImmutableMap<String, RestxSpec>
focal_class.signature: ImmutableMap<String, RestxSpec> findAllSpecs()
focal_class.class_method_signature: RestxSpecRepository.buildSpecsMap(boolean searchInSources)
focal_class.full_signature: protected Map<String, RestxSpec> buildSpecsMap(boolean searchInSources)
focal_class.identifier: buildSpecsMap
focal_class.modifiers: protected
focal_class.parameters: (boolean searchInSources)
focal_class.return: Map<String, RestxSpec>
focal_class.signature: Map<String, RestxSpec> buildSpecsMap(boolean searchInSources)
focal_class.class_method_signature: RestxSpecRepository.filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_class.full_signature:  Iterable<String> filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_class.identifier: filterSpecsByOperation
focal_class.parameters: (ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_class.class_method_signature: RestxSpecRepository.findWhensMatchingRequest(ImmutableMap<String, RestxSpec> allSpecs, RestxRequest restxRequest)
focal_class.full_signature:  Iterable<WhenHttpRequest> findWhensMatchingRequest(ImmutableMap<String, RestxSpec> allSpecs, RestxRequest restxRequest)
focal_class.identifier: findWhensMatchingRequest
focal_class.parameters: (ImmutableMap<String, RestxSpec> allSpecs, RestxRequest restxRequest)
focal_class.return: Iterable<WhenHttpRequest>
focal_class.signature: Iterable<WhenHttpRequest> findWhensMatchingRequest(ImmutableMap<String, RestxSpec> allSpecs, RestxRequest restxRequest)
focal_method.body: Iterable<String> filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path) {
          StdRestxRequestMatcher matcher = new StdRestxRequestMatcher(httpMethod, path);
          Collection<String> specs = Lists.newArrayList();
          for (Map.Entry<String, RestxSpec> spec : allSpecs.entrySet()) {
              for (When when : spec.getValue().getWhens()) {
                  if (when instanceof WhenHttpRequest) {
                      WhenHttpRequest request = (WhenHttpRequest) when;
                      String requestPath = request.getPath();
                      if (!requestPath.startsWith("/")) {
                          requestPath = "/" + requestPath;
                      }
                      if (requestPath.indexOf("?") != -1) {
                          requestPath = requestPath.substring(0, requestPath.indexOf("?"));
                      }
                      Optional<? extends RestxRequestMatch> match = matcher.match(request.getMethod(), requestPath);
                      if (match.isPresent()) {
                          specs.add(spec.getKey());
                          break;
                      }
                  }
              }
          }
          return specs;
      }
focal_method.class_method_signature: RestxSpecRepository.filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_method.full_signature:  Iterable<String> filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_method.identifier: filterSpecsByOperation
focal_method.invocations: newArrayList entrySet getWhens getValue getPath startsWith indexOf substring indexOf match getMethod isPresent add getKey
focal_method.parameters: (ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)
focal_method.return: Iterable<String>
focal_method.signature: Iterable<String> filterSpecsByOperation(ImmutableMap<String, RestxSpec> allSpecs,
                                                      String httpMethod, String path)