forked from karatelabs/karate
-
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.
- Loading branch information
1 parent
b936233
commit d9b96ee
Showing
6 changed files
with
54 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package json; | ||
|
||
import com.intuit.karate.Results; | ||
import com.intuit.karate.Runner; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class NullTest { | ||
void shouldFail(String name) { | ||
Results results = Runner.path("src/test/java/json/" + name + ".feature").parallel(1); | ||
assertEquals(1, results.getFailCount(), results.getErrorMessages()); | ||
} | ||
|
||
@Test | ||
void testEmptyObject() { | ||
shouldFail("empty-object"); | ||
} | ||
|
||
@Test | ||
void testEmptyString() { | ||
shouldFail("empty-string"); | ||
} | ||
|
||
@Test | ||
void testRecommend() { | ||
shouldFail("recommend"); | ||
} | ||
} |
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 @@ | ||
Feature: | ||
|
||
Scenario: empty object should fail: | ||
* def response = {} | ||
* match response.id == '#null' | ||
* match response.time == '#present' |
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 @@ | ||
Feature: | ||
|
||
Scenario: empty reponse should fail: | ||
* def response = '' | ||
* match response.time == '#present' | ||
* match response.id == '#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Feature: | ||
|
||
Scenario: recommended to use should not fail: | ||
* def response = '' | ||
* match response == { id: '#null', time: '#present' } |