Commit e98c5c66 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

make sure that types are also validated

parent 834fdc75
......@@ -106,7 +106,7 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
.andDo(document("projects/project_data/list",
responseFields(
subsectionWithPath("[]")
.description("list of projects").type("array<Project>"))))
.description("list of projects").type(JsonFieldType.ARRAY))))
.andReturn().getResponse().getContentAsString();
int projects = new JsonParser()
......@@ -198,19 +198,19 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
responseFields(
subsectionWithPath("data")
.description("list of log entries")
.type("array<LogEntry>"),
.type(JsonFieldType.ARRAY),
fieldWithPath("filteredSize")
.description("number of entries that match filter criteria")
.type("number"),
.type(JsonFieldType.NUMBER),
fieldWithPath("length")
.description("number of entries in this response")
.type("number"),
.type(JsonFieldType.NUMBER),
fieldWithPath("start")
.description("number of first entry in this response")
.type("number"),
.type(JsonFieldType.NUMBER),
fieldWithPath("totalSize")
.description("number of all log entries")
.type("number"))))
.type(JsonFieldType.NUMBER))))
.andExpect(status().is2xxSuccessful());
}
......@@ -226,13 +226,13 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
responseFields(
subsectionWithPath("reactionAnnotations")
.description("list of reaction annotation types")
.type("map<type,number>"),
.type(JsonFieldType.OBJECT),
subsectionWithPath("elementAnnotations")
.description("list of element annotation types")
.type("map<type,number>"),
.type(JsonFieldType.OBJECT),
fieldWithPath("publications")
.description("number of publications included in the project")
.type("number"))))
.type(JsonFieldType.NUMBER))))
.andExpect(status().is2xxSuccessful());
}
......@@ -258,13 +258,13 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
requestFields(
fieldWithPath("[]")
.description("list of privileges to grant")
.type("array<Privilege>"),
.type(JsonFieldType.ARRAY),
fieldWithPath("[].privilegeType")
.description("type of privilege (READ_PROJECT/WRITE_PROJECT)")
.type("string"),
.type(JsonFieldType.STRING),
fieldWithPath("[].login")
.description("user login who should gain access")
.type("string"))))
.type(JsonFieldType.STRING))))
.andExpect(status().is2xxSuccessful());
assertTrue(userService.getUserByLogin(CURATOR_LOGIN, true).getPrivileges()
......@@ -294,13 +294,13 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
requestFields(
fieldWithPath("[]")
.description("list of privileges to revoke")
.type("array<Privilege>"),
.type(JsonFieldType.ARRAY),
fieldWithPath("[].privilegeType")
.description("type of privilege (READ_PROJECT/WRITE_PROJECT)")
.type("string"),
.type(JsonFieldType.STRING),
fieldWithPath("[].login")
.description("user login who should lose access")
.type("string"))))
.type(JsonFieldType.STRING))))
.andExpect(status().is2xxSuccessful());
assertFalse(curator.getPrivileges().contains(new Privilege(PrivilegeType.READ_PROJECT, TEST_PROJECT)));
......@@ -343,29 +343,29 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
requestFields(
fieldWithPath("project.version")
.description("version of the project")
.type("string")
.type(JsonFieldType.STRING)
.optional(),
fieldWithPath("project.name")
.description("name of the project")
.type("string")
.type(JsonFieldType.STRING)
.optional(),
fieldWithPath("project.notifyEmail")
.description("email address that should be when something change in the project")
.type("string")
.type(JsonFieldType.STRING)
.optional(),
subsectionWithPath("project.organism")
.description("organism associated with the project")
.type("Reference")
.type(JsonFieldType.OBJECT)
.optional(),
subsectionWithPath("project.disease")
.description("disease associated with the project")
.type("Reference")
.type(JsonFieldType.OBJECT)
.optional(),
fieldWithPath("project.mapCanvasType")
.description(
"type of map canvas engine to be used when visualizing map, for now there are only two options available: "
+ snippets.getOptionsAsString(MapCanvasType.class))
.type("string")
.type(JsonFieldType.STRING)
.optional()),
snippets.getProjectSnippet()))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment