-
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.
- Test Kit - Enabling test data loading from file (#235)
* - Test Kit - Enabling test data loading from file * - Test Kit - Enabling test data loading from file * - Formatting * - Formatting * - Refactoring - removing double code * - Refactoring - replace loop with stream * - Fixing typo in changelog * - Replacing custom "file:" constant with ResourceUtils.FILE_URL_PREFIX * - Code formatting fixed * - File prefix changed to resource-file: * - Formatting fixed * adding commons-io dependency * refactoring commons-exec dependency version --------- Co-authored-by: Tucakovic, Vladimir <[email protected]> Co-authored-by: Leto Bukarica <[email protected]>
- Loading branch information
1 parent
c5cd9a4
commit f2ce10e
Showing
7 changed files
with
474 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"author": "vladiIkor", | ||
"pullrequestId": "235", | ||
"message": "Set value of 'body' in test-kit-definition as reference to a file on the classpath" | ||
} |
Large diffs are not rendered by default.
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
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
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: 20 additions & 0 deletions
20
...test-kit/src/test/java/de/ikor/sip/foundation/testkit/workflow/MessagePropertiesTest.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,20 @@ | ||
package de.ikor.sip.foundation.testkit.workflow; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
import de.ikor.sip.foundation.testkit.configurationproperties.models.MessageProperties; | ||
import java.io.FileNotFoundException; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class MessagePropertiesTest { | ||
MessageProperties subject = new MessageProperties(); | ||
|
||
@Test | ||
void when_BodyReferencesFile_thenBodyContentIsReadFromFile() { | ||
subject.setBody("resource-file:body.json"); | ||
FileNotFoundException fileNotFoundException = | ||
assertThrows(FileNotFoundException.class, () -> subject.getBody()); | ||
assertThat(fileNotFoundException.getMessage()).contains("body.json"); | ||
} | ||
} |