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

documentation of get project statistics API call

parent a7fb02a7
......@@ -108,7 +108,7 @@ include::{snippets}/projects/project_data/get_source_file/curl-request.adoc[]
include::{snippets}/projects/project_data/get_source_file/response-body.adoc[]
== Get logs
Gets source file used to create the project.
Gets logs generated on project upload.
=== Path Parameters
include::{snippets}/projects/project_data/get_project_logs/path-parameters.adoc[]
......@@ -125,3 +125,18 @@ include::{snippets}/projects/project_data/get_project_logs/curl-request.adoc[]
=== Sample Response
include::{snippets}/projects/project_data/get_project_logs/response-body.adoc[]
== Get statistics
Gets set of statistics about the project.
=== Path Parameters
include::{snippets}/projects/project_data/get_project_statistics/path-parameters.adoc[]
=== Response Fields
include::{snippets}/projects/project_data/get_project_statistics/response-fields.adoc[]
=== CURL sample
include::{snippets}/projects/project_data/get_project_statistics/curl-request.adoc[]
=== Sample Response
include::{snippets}/projects/project_data/get_project_statistics/response-body.adoc[]
......@@ -154,12 +154,12 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
.andDo(document("projects/project_data/get_project_logs",
requestParameters(
parameterWithName("start").description("number of first entry in this response"),
parameterWithName("sortColumn").description("log entry column that should be used for sorting (default: id)"),
parameterWithName("sortColumn")
.description("log entry column that should be used for sorting (default: id)"),
parameterWithName("sortOrder").description("log entry sort order (asc, desc)"),
parameterWithName("level").description("level of log entry (warning, error)"),
parameterWithName("length").description("number of log entres we want to obtain"),
parameterWithName("search").description("search query used for filtering")
),
parameterWithName("search").description("search query used for filtering")),
pathParameters(parameterWithName("projectId").description("project identifier")),
responseFields(
subsectionWithPath("data")
......@@ -180,6 +180,28 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
.andExpect(status().is2xxSuccessful());
}
@Test
public void testGetStatisticsForProject() throws Exception {
createProject(TEST_PROJECT);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/statistics", TEST_PROJECT).session(session);
mockMvc.perform(request).andDo(document("projects/project_data/get_project_statistics",
pathParameters(parameterWithName("projectId").description("project identifier")),
responseFields(
subsectionWithPath("reactionAnnotations")
.description("list of reaction annotation types")
.type("Map<type,number>"),
subsectionWithPath("elementAnnotations")
.description("list of element annotation types")
.type("Map<type,number>"),
fieldWithPath("publications")
.description("number of publications included in the project")
.type("number"))))
.andExpect(status().is2xxSuccessful());
}
@Test
public void testGrantPrivilege() throws Exception {
createProject(TEST_PROJECT);
......
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