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
1c4e1dc8
Commit
1c4e1dc8
authored
Jul 25, 2019
by
Piotr Gawron
Browse files
returned value should be a list not a string
parent
f84e94a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java
View file @
1c4e1dc8
...
...
@@ -102,12 +102,13 @@ public class OverlayRestImpl extends BaseRestImpl {
return
result
;
}
private
String
getDeprecatedColumns
(
Layout
overlay
)
{
private
List
<
String
>
getDeprecatedColumns
(
Layout
overlay
)
{
try
{
String
result
=
""
;
List
<
String
>
result
=
new
ArrayList
<>()
;
for
(
ColorSchemaColumn
column
:
new
ColorSchemaReader
().
getDeprecatedColumns
(
overlay
))
{
result
+=
column
.
name
()
+
","
;
result
.
add
(
column
.
name
()
)
;
}
logger
.
debug
(
result
);
return
result
;
}
catch
(
IOException
|
InvalidColorSchemaException
e
)
{
throw
new
InvalidStateException
(
e
);
...
...
web/src/test/java/lcsb/mapviewer/web/OverlayControllerIntegrationTest.java
View file @
1c4e1dc8
package
lcsb.mapviewer.web
;
import
static
org
.
junit
.
Assert
.
*
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.*;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
...
...
@@ -1051,12 +1051,11 @@ public class OverlayControllerIntegrationTest extends ControllerIntegrationTest
String
response
=
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is2xxSuccessful
())
.
andReturn
().
getResponse
().
getContentAsString
();
Str
in
g
deprecatedColumns
=
new
JsonParser
()
in
t
deprecatedColumns
=
new
JsonParser
()
.
parse
(
response
)
.
getAsJsonObject
().
get
(
"deprecatedColumns"
).
getAs
String
();
.
getAsJsonObject
().
get
(
"deprecatedColumns"
).
getAs
JsonArray
().
size
();
assertNotNull
(
deprecatedColumns
);
assertFalse
(
deprecatedColumns
.
isEmpty
());
assertEquals
(
2
,
deprecatedColumns
);
}
}
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