Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
6509933d
Commit
6509933d
authored
Feb 13, 2020
by
Piotr Gawron
Browse files
documentation for listing all maps API call
parent
dacc07d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
web/src/main/asciidoc/projects/project_maps.adoc
0 → 100644
View file @
6509933d
= Rest API Documentation - Project maps
Piotr Gawron
v{project-version} {build-time}
:toc: left
:sectnums:
== List maps
List all (sub)maps in a project.
=== Path Parameters
include::{snippets}/projects/project_maps/list/path-parameters.adoc[]
=== Response Fields
include::{snippets}/projects/project_maps/list/response-fields.adoc[]
=== CURL sample
include::{snippets}/projects/project_maps/list/curl-request.adoc[]
=== Sample Response
include::{snippets}/projects/project_maps/list/response-body.adoc[]
web/src/test/java/lcsb/mapviewer/web/MapControllerIntegrationTest.java
View file @
6509933d
...
...
@@ -2,8 +2,10 @@ package lcsb.mapviewer.web;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
patch
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvcRestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
RestDocumentationRequestBuilders
.*;
import
static
org
.
springframework
.
restdocs
.
payload
.
PayloadDocumentation
.*;
import
static
org
.
springframework
.
restdocs
.
request
.
RequestDocumentation
.*;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -223,13 +225,27 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/projects/*/models/"
)
.
contentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isNotFound
());
}
@Test
public
void
testGetMapsWithForProject
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_LOGIN
,
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/projects/{projectId}/models/"
,
BUILT_IN_PROJECT
).
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is2xxSuccessful
())
.
andDo
(
document
(
"projects/project_maps/list"
,
pathParameters
(
parameterWithName
(
"projectId"
).
description
(
"project identifier"
)),
responseFields
(
subsectionWithPath
(
"[]"
).
description
(
"list of maps"
).
type
(
"Array<Map>"
))))
.
andReturn
().
getResponse
().
getContentAsString
();
}
@Test
public
void
testUpdateMapWithUndefinedProject
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_LOGIN
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment