-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from DiSSCo/feature/mas-input
MasInput
- Loading branch information
Showing
10 changed files
with
149 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 13 additions & 7 deletions
20
.../java/eu/dissco/orchestration/backend/database/jooq/tables/MachineAnnotationServices.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
59 changes: 49 additions & 10 deletions
59
...o/orchestration/backend/database/jooq/tables/records/MachineAnnotationServicesRecord.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/eu/dissco/orchestration/backend/domain/MasInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package eu.dissco.orchestration.backend.domain; | ||
|
||
public record MasInput( | ||
String inputField, | ||
String targetField | ||
) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import static eu.dissco.orchestration.backend.testutils.TestUtils.MAPPER; | ||
import static eu.dissco.orchestration.backend.testutils.TestUtils.OBJECT_CREATOR; | ||
import static eu.dissco.orchestration.backend.testutils.TestUtils.givenMas; | ||
import static eu.dissco.orchestration.backend.testutils.TestUtils.givenMasInput; | ||
import static eu.dissco.orchestration.backend.testutils.TestUtils.givenMasRecord; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
|
@@ -45,6 +46,20 @@ void testCreateMas() { | |
assertThat(result).containsOnly(masRecord); | ||
} | ||
|
||
@Test | ||
void testCreateMasNoMasInput() { | ||
// Given | ||
var masRecord = givenMasRecord(1, null); | ||
|
||
// When | ||
repository.createMachineAnnotationService(masRecord); | ||
var result = repository.getMachineAnnotationServices(1, 10); | ||
|
||
// Then | ||
assertThat(result).containsOnly(masRecord); | ||
} | ||
|
||
|
||
@Test | ||
void testUpdateMas() { | ||
// Given | ||
|
@@ -73,6 +88,19 @@ void testGetMasById() { | |
assertThat(result).isEqualTo(expected); | ||
} | ||
|
||
@Test | ||
void testGetMasByIdNoMasInput() { | ||
// Given | ||
var expected = givenMasRecord(1, null); | ||
postMass(List.of(expected)); | ||
|
||
// When | ||
var result = repository.getMachineAnnotationService(HANDLE); | ||
|
||
// Then | ||
assertThat(result).isEqualTo(expected); | ||
} | ||
|
||
@Test | ||
void testGetMass() { | ||
// Given | ||
|
@@ -186,7 +214,8 @@ private MachineAnnotationServiceRecord givenUpdatedRecord() { | |
"[email protected]", | ||
"https://www.know.dissco.tech/no_sla", | ||
"fancy-topic-name", | ||
2 | ||
2, | ||
givenMasInput() | ||
), | ||
null | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.