-
-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR - Merge pull request #600 from wojdeb/FileUpload
added helloworld example of upload files using POST
- Loading branch information
Showing
7 changed files
with
56 additions
and
5 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
17 changes: 17 additions & 0 deletions
17
...ava/org/jsmart/zerocode/testhelp/tests/helloworldfileupload/HelloWorldFileUploadTest.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,17 @@ | ||
package org.jsmart.zerocode.testhelp.tests.helloworldfileupload; | ||
|
||
import org.jsmart.zerocode.core.domain.Scenario; | ||
import org.jsmart.zerocode.core.domain.TargetEnv; | ||
import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@TargetEnv("postman_echo_host.properties") | ||
@RunWith(ZeroCodeUnitRunner.class) | ||
public class HelloWorldFileUploadTest { | ||
|
||
@Test | ||
@Scenario("helloworld_file_upload/hello_world_file_upload_test.json") | ||
public void testFileUpload() throws Exception { | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
http-testing/src/test/resources/helloworld_file_upload/hello_world_file_upload_test.json
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,26 @@ | ||
{ | ||
"scenarioName": "Assert that file has been uploaded successfully", | ||
"steps": [ | ||
{ | ||
"name": "post_file", | ||
"url": "/post", | ||
"method": "POST", | ||
"request": { | ||
"headers": { | ||
"Content-Type": "multipart/form-data" | ||
}, | ||
"body": { | ||
"files": ["file:helloworld_file_upload/textfile.txt"] | ||
} | ||
}, | ||
"verify": { | ||
"status": 200, | ||
"body": { | ||
"files": { | ||
"['textfile.txt']": "data:application/octet-stream;base64,SGVsbG9Xb3JsZA==" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
http-testing/src/test/resources/helloworld_file_upload/textfile.txt
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 @@ | ||
HelloWorld |
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,6 @@ | ||
# Web Server host and port | ||
web.application.endpoint.host=https://postman-echo.com | ||
# Web Service Port; Leave it blank in case it is default port i.e. 80 or 443 etc | ||
web.application.endpoint.port= | ||
# Web Service context; Leave it blank in case you do not have a common context | ||
web.application.endpoint.context= |