Search in sources :

Example 1 with IntegrationScenario

use of org.contextmapper.dsl.generator.mdsl.model.IntegrationScenario in project context-mapper-dsl by ContextMapper.

the class MDSLModelCreatorTest method canCreateUpdateAndReadModelWithScenarioAndStory.

@Test
void canCreateUpdateAndReadModelWithScenarioAndStory() {
    // given
    ServiceSpecification mdslModel = new ServiceSpecification();
    IntegrationScenario scenarioModel = new org.contextmapper.dsl.generator.mdsl.model.IntegrationScenario();
    scenarioModel.setName("SampleScenarioName");
    Story storyModel = new org.contextmapper.dsl.generator.mdsl.model.Story("SampleStoryName", "SampleActor", "SampleAction", "SampleGoal");
    // when
    scenarioModel.addStory(storyModel);
    mdslModel.addScenario(scenarioModel);
    assertEquals("SampleScenarioName", mdslModel.getScenarios().get(0).getName());
    assertEquals("SampleStoryName", scenarioModel.getStories().get(0).getName());
    // when
    storyModel.setName("NewName");
    storyModel.setPersona("NewActor");
    storyModel.setAction("NewAction");
    storyModel.setGoal("NewGoal");
    assertEquals("NewName", scenarioModel.getStories().get(0).getName());
    assertEquals("NewActor", scenarioModel.getStories().get(0).getPersona());
    assertEquals("NewAction", scenarioModel.getStories().get(0).getAction());
    assertEquals("NewGoal", scenarioModel.getStories().get(0).getGoal());
}
Also used : ServiceSpecification(org.contextmapper.dsl.generator.mdsl.model.ServiceSpecification) IntegrationScenario(org.contextmapper.dsl.generator.mdsl.model.IntegrationScenario) Story(org.contextmapper.dsl.generator.mdsl.model.Story) AbstractCMLInputFileTest(org.contextmapper.dsl.AbstractCMLInputFileTest) Test(org.junit.jupiter.api.Test)

Aggregations

AbstractCMLInputFileTest (org.contextmapper.dsl.AbstractCMLInputFileTest)1 IntegrationScenario (org.contextmapper.dsl.generator.mdsl.model.IntegrationScenario)1 ServiceSpecification (org.contextmapper.dsl.generator.mdsl.model.ServiceSpecification)1 Story (org.contextmapper.dsl.generator.mdsl.model.Story)1 Test (org.junit.jupiter.api.Test)1