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
24334724
Commit
24334724
authored
Dec 20, 2019
by
Piotr Gawron
Browse files
docs for API call fetching project source file added
parent
206eb7d7
Pipeline
#18086
failed with stage
in 14 minutes and 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
web/src/main/asciidoc/projects/project_data.adoc
View file @
24334724
...
...
@@ -88,15 +88,22 @@ include::{snippets}/projects/project_data/update/response-body.adoc[]
=== Path Parameters
include::{snippets}/projects/project_data/delete/path-parameters.adoc[]
//=== Request Fields
//include::{snippets}/projects/project_data/delete/request-fields.adoc[]
//=== Response Fields
//include::{snippets}/projects/project_data/delete/response-fields.adoc[]
=== CURL sample
include::{snippets}/projects/project_data/delete/curl-request.adoc[]
=== Sample Response
include::{snippets}/projects/project_data/delete/response-body.adoc[]
== Get source
Gets source file used to create the project.
=== Path Parameters
include::{snippets}/projects/project_data/get_source_file/path-parameters.adoc[]
=== CURL sample
include::{snippets}/projects/project_data/get_source_file/curl-request.adoc[]
=== Sample Response
include::{snippets}/projects/project_data/get_source_file/response-body.adoc[]
web/src/test/java/lcsb/mapviewer/web/ControllerIntegrationTest.java
View file @
24334724
...
...
@@ -5,6 +5,9 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
import
java.awt.geom.Point2D
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.concurrent.*
;
...
...
@@ -228,6 +231,11 @@ abstract public class ControllerIntegrationTest {
entry
.
setType
(
ProjectLogEntryType
.
OTHER
);
entry
.
setContent
(
"This is warning message"
);
project
.
addLogEntry
(
entry
);
try
{
project
.
setInputData
(
createFile
(
Files
.
readAllBytes
(
Paths
.
get
(
"./src/test/resources/generic.xml"
)),
userService
.
getUserByLogin
(
BUILT_IN_TEST_ADMIN_LOGIN
)));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
ModelData
map
=
new
ModelData
();
map
.
setName
(
"map_name"
);
...
...
web/src/test/java/lcsb/mapviewer/web/ProjectControllerIntegrationTest.java
View file @
24334724
...
...
@@ -82,6 +82,19 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
assertEquals
(
"admin should see all projects"
,
projectDao
.
getCount
(),
projects
);
}
@Test
public
void
testGetSourceFile
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
BUILT_IN_TEST_ADMIN_LOGIN
,
BUILT_IN_TEST_ADMIN_PASSWORD
);
createProject
(
TEST_PROJECT
);
RequestBuilder
request
=
get
(
"/projects/{projectId}:downloadSource"
,
TEST_PROJECT
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is2xxSuccessful
())
.
andDo
(
document
(
"projects/project_data/get_source_file"
,
pathParameters
(
parameterWithName
(
"projectId"
).
description
(
"project identifier"
))));
}
@Test
public
void
testGetLimitedProjectsAsCurator
()
throws
Exception
{
Project
project
=
createProject
(
TEST_PROJECT
);
...
...
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