Search in sources :

Example 1 with SplitBoundedContextRelationshipType

use of org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType in project context-mapper-dsl by ContextMapper.

the class SplitSystemIntoSubsystemsTest method relationshipTypeCanHandleNullValue.

@Test
public void relationshipTypeCanHandleNullValue() {
    // given
    String label = null;
    // when
    SplitBoundedContextRelationshipType type = SplitBoundedContextRelationshipType.byLabel(label);
    // then
    assertEquals(SplitBoundedContextRelationshipType.NEW_CONTEXT_BECOMES_UPSTREAM, type);
}
Also used : SplitBoundedContextRelationshipType(org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with SplitBoundedContextRelationshipType

use of org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType in project context-mapper-dsl by ContextMapper.

the class SplitSystemIntoSubsystemsTest method canGetRelationshipTypeByLabel.

@ParameterizedTest
@CsvSource({ "Upstream, NEW_CONTEXT_BECOMES_UPSTREAM", "Downstream, NEW_CONTEXT_BECOMES_DOWNSTREAM" })
public void canGetRelationshipTypeByLabel(String inputLabel, String expectedType) {
    // given
    String label = inputLabel;
    // when
    SplitBoundedContextRelationshipType type = SplitBoundedContextRelationshipType.byLabel(label);
    // then
    assertEquals(SplitBoundedContextRelationshipType.valueOf(expectedType), type);
}
Also used : SplitBoundedContextRelationshipType(org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType) CsvSource(org.junit.jupiter.params.provider.CsvSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 3 with SplitBoundedContextRelationshipType

use of org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType in project context-mapper-dsl by ContextMapper.

the class SplitSystemIntoSubsystemsTest method canGetRelationshipTypeLabel.

@Test
public void canGetRelationshipTypeLabel() {
    // given
    SplitBoundedContextRelationshipType upstream = SplitBoundedContextRelationshipType.NEW_CONTEXT_BECOMES_UPSTREAM;
    SplitBoundedContextRelationshipType downstream = SplitBoundedContextRelationshipType.NEW_CONTEXT_BECOMES_DOWNSTREAM;
    // when
    String upstreamLabel = upstream.getLabel();
    String downstreamLabel = downstream.getLabel();
    // then
    assertEquals("Upstream", upstreamLabel);
    assertEquals("Downstream", downstreamLabel);
}
Also used : SplitBoundedContextRelationshipType(org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

SplitBoundedContextRelationshipType (org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 Test (org.junit.jupiter.api.Test)2 CsvSource (org.junit.jupiter.params.provider.CsvSource)1