@Test
public void should_find_specs_for_request() throws Exception {

    RestxSpecRepository resource = getRestxSpecRepository();
    WhenHttpRequest when1;
    WhenHttpRequest when2;
    WhenHttpRequest when3;
    ImmutableMap<String, RestxSpec> allSpecs = ImmutableMap.of(
            "cases/test/test.spec.yaml", spec("should say hello on path",
                        when1 = when("GET", "/messages/xavier")),
            "cases/test/test2.spec.yaml", spec("should say hello w/ query param",
                        when2 = when("GET", "/messages?who=xavier")),
            "cases/test/test3.spec.yaml", spec("should say hello w/ other query param",
                        when3 = when("GET", "/messages?who=jules"))
    );
    assertThat(resource.findWhensMatchingRequest(allSpecs, request("GET", "/messages/xavier")))
            .isNotEmpty().containsExactly(when1);
    assertThat(resource.findWhensMatchingRequest(allSpecs, request("GET", "/messages?who=xavier")))
            .isNotEmpty().containsExactly(when2);
    assertThat(resource.findWhensMatchingRequest(allSpecs, request("GET", "/messages?who=xavier&test=anything")))
            .isNotEmpty().containsExactly(when2);
    assertThat(resource.findWhensMatchingRequest(allSpecs, request("GET", "/messages?who=jules")))
            .isNotEmpty().containsExactly(when3);
}