use of com.github.tomakehurst.wiremock.stubbing.InMemoryStubMappings in project wiremock by wiremock.
the class JsonFileMappingsSourceTest method loadsMappingsViaClasspathFileSource.
@Test
public void loadsMappingsViaClasspathFileSource() {
ClasspathFileSource fileSource = new ClasspathFileSource("jar-filesource");
JsonFileMappingsSource source = new JsonFileMappingsSource(fileSource);
InMemoryStubMappings stubMappings = new InMemoryStubMappings();
source.loadMappingsInto(stubMappings);
List<StubMapping> allMappings = stubMappings.getAll();
assertThat(allMappings, hasSize(2));
List<String> mappingRequestUrls = asList(allMappings.get(0).getRequest().getUrl(), allMappings.get(1).getRequest().getUrl());
assertThat(mappingRequestUrls, is(asList("/second_test", "/test")));
}
Aggregations