RestxSpecRepository { synchronized ImmutableMap<String, RestxSpec> findAllSpecs() { if (allSpecs == null) { allSpecs = ImmutableMap.copyOf(buildSpecsMap(false)); } return allSpecs; } RestxSpecRepository(RestxSpecLoader specLoader); Iterable<String> findAll(); Optional<RestxSpec> findSpecById(String id); Iterable<String> findSpecsByOperation(String httpMethod, String path); Iterable<WhenHttpRequest> findSpecsByRequest(RestxRequest request);  }
@Test public void should_find_specs_in_classpath() throws Exception { RestxSpecRepository resource = getRestxSpecRepository(); ImmutableMap<String, RestxSpec> allSpecs = resource.findAllSpecs(); assertThat(allSpecs).isNotEmpty().containsKey("cases/test/test.spec.yaml"); assertThat(allSpecs.get("cases/test/test.spec.yaml").getTitle()).isEqualTo("should say hello"); }