File tree Expand file tree Collapse file tree 3 files changed +61
-2
lines changed
java/com/fusiondb/studio/api Expand file tree Collapse file tree 3 files changed +61
-2
lines changed Original file line number Diff line number Diff line change 2727import static com .fusiondb .studio .api .API .*;
2828import static io .restassured .RestAssured .given ;
2929import static io .restassured .http .ContentType .JSON ;
30+ import static io .restassured .module .jsv .JsonSchemaValidator .matchesJsonSchemaInClasspath ;
3031import static org .apache .http .HttpStatus .*;
3132import static org .junit .jupiter .api .Assertions .assertFalse ;
3233import static org .junit .jupiter .api .Assertions .assertTrue ;
@@ -95,8 +96,10 @@ private ExtractableResponse<Response> getUser(final String userId) {
9596 when ().
9697 get (getApiBaseUri () + "/user/user" + userId ).
9798 then ().
98- statusCode (SC_OK )
99- .extract ();
99+ statusCode (SC_OK ).
100+ assertThat ().
101+ body (matchesJsonSchemaInClasspath ("user-schema.json" )).
102+ extract ();
100103 }
101104
102105 private void createUser (final String userId ) {
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " http://json-schema.org/draft-07/schema#" ,
3+ "title" : " Collection" ,
4+ "type" : " object" ,
5+ "required" : [
6+ " key"
7+ ],
8+ "properties" : {
9+ "key" : {
10+ "type" : " string"
11+ },
12+ "value" : {
13+ "type" : " string"
14+ }
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " http://json-schema.org/draft-07/schema#" ,
3+ "title" : " User" ,
4+ "type" : " object" ,
5+ "required" : [
6+ " userName"
7+ ],
8+ "properties" : {
9+ "userName" : {
10+ "type" : " string"
11+ },
12+ "password" : {
13+ "type" : " string"
14+ },
15+ "umask" : {
16+ "type" : " integer"
17+ },
18+ "enabled" : {
19+ "type" : " boolean"
20+ },
21+ "expired" : {
22+ "type" : " boolean"
23+ },
24+ "primaryGroup" : {
25+ "type" : " string"
26+ },
27+ "groups" : {
28+ "type" : " array" ,
29+ "items" : {
30+ "type" : " string"
31+ }
32+ },
33+ "metadata" : {
34+ "type" : " array" ,
35+ "items" : {
36+ "$ref" : " attribute-schema.json"
37+ }
38+ }
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments