}
@Test
public void returnsMappingInScenarioOnlyWhenStateIsCorrect() {
StubMapping firstGetMapping = new StubMapping(
new RequestPattern(GET, "/scenario/resource"),
new ResponseDefinition(204, "Initial content"));
firstGetMapping.setScenarioName("TestScenario");
firstGetMapping.setRequiredScenarioState(STARTED);
mappings.addMapping(firstGetMapping);
StubMapping putMapping = new StubMapping(
new RequestPattern(PUT, "/scenario/resource"),
new ResponseDefinition(204, ""));
putMapping.setScenarioName("TestScenario");
putMapping.setRequiredScenarioState(STARTED);
putMapping.setNewScenarioState("Modified");
mappings.addMapping(putMapping);
StubMapping secondGetMapping = new StubMapping(
new RequestPattern(GET, "/scenario/resource"),
new ResponseDefinition(204, "Modified content"));
secondGetMapping.setScenarioName("TestScenario");
secondGetMapping.setRequiredScenarioState("Modified");
mappings.addMapping(secondGetMapping);