Skip to content

Commit

Permalink
Set default cardinality required for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
robertcsakany committed Dec 12, 2023
1 parent 11dbdc0 commit 5f87dab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rule CreateCardinalityForTransferActionDeclarationInput
to t : JUDOPSM!Cardinality {
t.setId("(jsl/" + s.getId() + ")/CreateCardinalityForTransferActionDeclarationInput");

t.lower = 0; //s.isRequired and not s.isMany ? 1 : 0;
t.lower = 1; //s.isRequired and not s.isMany ? 1 : 0;
t.upper = 1;
}

Expand All @@ -87,7 +87,7 @@ rule CreateCardinalityForTransferActionDeclarationOutput
to t : JUDOPSM!Cardinality {
t.setId("(jsl/" + s.getId() + ")/CreateCardinalityForTransferActionDeclarationOutput");

t.lower = 0; // s.isRequired and not s.isMany ? 1 : 0;
t.lower = 1; // s.isRequired and not s.isMany ? 1 : 0;
t.upper = 1;
}

Expand All @@ -98,7 +98,7 @@ rule CreateCardinalityForTransferActionDeclarationEntityInput
to t : JUDOPSM!Cardinality {
t.setId("(jsl/" + s.getId() + ")/CreateCardinalityForTransferActionDeclarationEntityInput");

t.lower = 0; //s.isRequired and not s.isMany ? 1 : 0;
t.lower = 1; //s.isRequired and not s.isMany ? 1 : 0;
t.upper = 1;
}

Expand All @@ -109,7 +109,7 @@ rule CreateCardinalityForTransferActionDeclarationEntityOutput
to t : JUDOPSM!Cardinality {
t.setId("(jsl/" + s.getId() + ")/CreateCardinalityForTransferActionDeclarationEntityOutput");

t.lower = 0; // s.isRequired and not s.isMany ? 1 : 0;
t.lower = 1; // s.isRequired and not s.isMany ? 1 : 0;
t.upper = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void assertOperation(String transferName, String operationName, boolean
} else {
assertThat(operation.getInput().getType(), equalTo(assertUnmappedTransferObject("UnmappedInputParameter")));
}
assertThat(operation.getInput().getCardinality().getLower(), equalTo(0));
assertThat(operation.getInput().getCardinality().getLower(), equalTo(1));
} else {
assertThat(operation.getInput(), is(nullValue()));
}
Expand All @@ -168,7 +168,7 @@ private void assertOperation(String transferName, String operationName, boolean
} else {
assertThat(operation.getOutput().getType(), equalTo(assertUnmappedTransferObject("UnmappedOutputParameter")));
}
assertThat(operation.getOutput().getCardinality().getLower(), equalTo(0));
assertThat(operation.getOutput().getCardinality().getLower(), equalTo(1));
} else {
assertThat(operation.getOutput(), is(nullValue()));
}
Expand Down

0 comments on commit 5f87dab

Please sign in to comment.