Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
a5178600
Commit
a5178600
authored
Aug 19, 2020
by
Piotr Gawron
Browse files
documentation for convert API call
parent
2a519253
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
web/src/main/asciidoc/converter.adoc
View file @
a5178600
...
...
@@ -20,3 +20,15 @@ include::{snippets}/converter/list_formats/response-fields.adoc[]
include::{snippets}/converter/list_formats/response-body.adoc[]
=== Convert network from an input format to an output format
==== CURL sample
include::{snippets}/converter/format_conversion/curl-request.adoc[]
==== Path Parameters
include::{snippets}/converter/format_conversion/path-parameters.adoc[]
==== Response Fields
include::{snippets}/converter/format_conversion/response-fields.adoc[]
web/src/test/java/lcsb/mapviewer/web/ConvertControllerIntegrationTest.java
View file @
a5178600
...
...
@@ -2,15 +2,17 @@ package lcsb.mapviewer.web;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvcRestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
payload
.
PayloadDocumentation
.
fieldWithPath
;
import
static
org
.
springframework
.
restdocs
.
payload
.
PayloadDocumentation
.
responseFields
;
import
static
org
.
springframework
.
t
est
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
t
est
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
post
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
RestDocumentationRequestBuilders
.*
;
import
static
org
.
springframework
.
restdocs
.
payload
.
PayloadDocumentation
.
*
;
import
static
org
.
springframework
.
r
est
docs
.
request
.
RequestDocumentation
.
parameterWithName
;
import
static
org
.
springframework
.
r
est
docs
.
request
.
RequestDocumentation
.
pathParameters
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
import
java.io.*
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.junit.Test
;
...
...
@@ -123,4 +125,23 @@ public class ConvertControllerIntegrationTest extends ControllerIntegrationTest
.
type
(
"Array<String>"
))));
}
@Test
public
void
convertCellDesignerToGpml
()
throws
Exception
{
File
file
=
new
File
(
"src/test/resources/convert/cd-sample.xml"
);
String
content
=
FileUtils
.
readFileToString
(
file
,
StandardCharsets
.
UTF_8
);
RequestBuilder
request
=
post
(
"/convert/{inputFormat}:{outputFormat}"
,
"CellDesigner_SBML"
,
"GPML"
)
.
header
(
"post-filename"
,
"input_file.xml"
)
.
content
(
content
.
getBytes
(
"UTF-8"
))
.
characterEncoding
(
"UTF-8"
);
mockMvc
.
perform
(
request
)
.
andDo
(
document
(
"converter/format_conversion"
,
pathParameters
(
parameterWithName
(
"inputFormat"
)
.
description
(
"input format (list of available formats be obtained from the /convert/ API)"
),
parameterWithName
(
"outputFormat"
)
.
description
(
"output format (list of available formats be obtained from the /convert/ API)"
))))
.
andExpect
(
status
().
is2xxSuccessful
());
}
}
web/src/test/resources/convert/cd-sample.xml
0 → 100644
View file @
a5178600
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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