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
477a3a8a
Commit
477a3a8a
authored
Jul 26, 2021
by
Piotr Gawron
Browse files
get submodel connections moved to controller
parent
566a859b
Changes
20
Hide whitespace changes
Inline
Side-by-side
model/src/main/java/lcsb/mapviewer/modelutils/serializer/id/ModelDataAsModelIdSerializer.java
0 → 100644
View file @
477a3a8a
package
lcsb.mapviewer.modelutils.serializer.id
;
import
java.io.IOException
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
lcsb.mapviewer.model.map.model.ModelData
;
public
class
ModelDataAsModelIdSerializer
extends
JsonSerializer
<
ModelData
>
{
@Override
public
void
serialize
(
final
ModelData
model
,
final
JsonGenerator
gen
,
final
SerializerProvider
serializers
)
throws
IOException
{
gen
.
writeStartObject
();
gen
.
writeNumberField
(
"modelId"
,
model
.
getId
());
gen
.
writeEndObject
();
}
}
\ No newline at end of file
rest-api
/src/main/java/lcsb/mapviewer/ap
i
/ElementIdentifierType.java
→
model
/src/main/java/lcsb/mapviewer/
modelutils/serializer/model/m
ap/ElementIdentifierType.java
View file @
477a3a8a
package
lcsb.mapviewer.ap
i
;
package
lcsb.mapviewer.
modelutils.serializer.model.m
ap
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
model/src/main/java/lcsb/mapviewer/modelutils/serializer/model/map/MinifiedBioEntitySerializer.java
0 → 100644
View file @
477a3a8a
package
lcsb.mapviewer.modelutils.serializer.model.map
;
import
java.io.IOException
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
lcsb.mapviewer.common.exception.InvalidStateException
;
import
lcsb.mapviewer.model.map.BioEntity
;
import
lcsb.mapviewer.model.map.reaction.Reaction
;
import
lcsb.mapviewer.model.map.species.Element
;
public
class
MinifiedBioEntitySerializer
extends
JsonSerializer
<
BioEntity
>
{
@Override
public
void
serialize
(
final
BioEntity
object
,
final
JsonGenerator
gen
,
final
SerializerProvider
serializers
)
throws
IOException
{
gen
.
writeStartObject
();
gen
.
writeNumberField
(
"id"
,
object
.
getId
());
gen
.
writeNumberField
(
"modelId"
,
object
.
getModelData
().
getId
());
if
(
object
instanceof
Element
)
{
gen
.
writeObjectField
(
"type"
,
ElementIdentifierType
.
ALIAS
);
}
else
if
(
object
instanceof
Reaction
)
{
gen
.
writeObjectField
(
"type"
,
ElementIdentifierType
.
REACTION
);
}
else
{
throw
new
InvalidStateException
(
"Unknown type of result: "
+
object
.
getClass
());
}
gen
.
writeEndObject
();
}
}
\ No newline at end of file
rest-api/src/main/java/lcsb/mapviewer/api/BaseRestImpl.java
View file @
477a3a8a
...
...
@@ -44,6 +44,7 @@ import lcsb.mapviewer.model.map.MiriamData;
import
lcsb.mapviewer.model.map.reaction.Reaction
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.modelutils.map.ElementUtils
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.persist.dao.map.species.ElementProperty
;
import
lcsb.mapviewer.services.QueryException
;
import
lcsb.mapviewer.services.interfaces.IConfigurationService
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectController.java
View file @
477a3a8a
...
...
@@ -7,6 +7,7 @@ import java.lang.reflect.InvocationTargetException;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashSet
;
...
...
@@ -42,6 +43,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
lcsb.mapviewer.annotation.services.annotators.AnnotatorException
;
import
lcsb.mapviewer.api.BaseController
;
...
...
@@ -54,11 +56,17 @@ import lcsb.mapviewer.model.Project;
import
lcsb.mapviewer.model.ProjectLogEntry
;
import
lcsb.mapviewer.model.cache.UploadedFileEntry
;
import
lcsb.mapviewer.model.graphics.MapCanvasType
;
import
lcsb.mapviewer.model.map.BioEntity
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.layout.ProjectBackground
;
import
lcsb.mapviewer.model.map.model.ModelData
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.model.security.PrivilegeType
;
import
lcsb.mapviewer.model.user.ConfigurationElementType
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.modelutils.serializer.id.ModelDataAsModelIdSerializer
;
import
lcsb.mapviewer.modelutils.serializer.model.map.MinifiedBioEntitySerializer
;
import
lcsb.mapviewer.persist.dao.map.species.ElementProperty
;
import
lcsb.mapviewer.services.ObjectExistsException
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
import
lcsb.mapviewer.services.QueryException
;
...
...
@@ -667,11 +675,36 @@ public class ProjectController extends BaseController {
}
}
static
class
SubmapConnection
{
@JsonSerialize
(
using
=
MinifiedBioEntitySerializer
.
class
)
public
BioEntity
from
;
@JsonSerialize
(
using
=
ModelDataAsModelIdSerializer
.
class
)
public
ModelData
to
;
public
SubmapConnection
(
Element
element
)
{
from
=
element
;
to
=
element
.
getSubmodel
().
getSubmodel
();
}
}
@PreAuthorize
(
"hasAnyAuthority('IS_ADMIN', 'READ_PROJECT:' + #projectId)"
)
@GetMapping
(
value
=
"/{projectId}/submapConnections"
)
public
List
<
Map
<
String
,
Object
>
>
getSubmapConnections
(
@PathVariable
(
value
=
"projectId"
)
String
projectId
)
public
List
<
SubmapConnection
>
getSubmapConnections
(
@PathVariable
(
value
=
"projectId"
)
String
projectId
)
throws
QueryException
{
return
projectController
.
getSubmapConnections
(
projectId
);
Project
project
=
getProject
(
projectId
);
Map
<
ElementProperty
,
List
<?
extends
Object
>>
properties
=
new
HashMap
<>();
properties
.
put
(
ElementProperty
.
PROJECT
,
Arrays
.
asList
(
project
));
properties
.
put
(
ElementProperty
.
SUBMAP_CONNECTION
,
Arrays
.
asList
(
Boolean
.
TRUE
));
List
<
Element
>
elements
=
elementService
.
getElementsByFilter
(
properties
,
true
);
List
<
SubmapConnection
>
result
=
new
ArrayList
<>();
for
(
Element
element
:
elements
)
{
if
(
element
.
getSubmodel
()
!=
null
)
{
result
.
add
(
new
SubmapConnection
(
element
));
}
}
return
result
;
}
@PreAuthorize
(
"hasAnyAuthority('IS_ADMIN', 'READ_PROJECT:' + #projectId) "
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java
View file @
477a3a8a
...
...
@@ -44,30 +44,5 @@ public class ProjectRestImpl extends BaseRestImpl {
return
project
;
}
public
List
<
Map
<
String
,
Object
>>
getSubmapConnections
(
String
projectId
)
throws
QueryException
{
Project
project
=
getProjectByProjectId
(
projectId
);
Map
<
ElementProperty
,
List
<?
extends
Object
>>
properties
=
new
HashMap
<>();
properties
.
put
(
ElementProperty
.
PROJECT
,
Arrays
.
asList
(
project
));
properties
.
put
(
ElementProperty
.
SUBMAP_CONNECTION
,
Arrays
.
asList
(
Boolean
.
TRUE
));
List
<
Element
>
elements
=
elementService
.
getElementsByFilter
(
properties
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
for
(
Element
element
:
elements
)
{
if
(
element
.
getSubmodel
()
!=
null
)
{
result
.
add
(
submodelConnectionToMap
(
element
));
}
}
return
result
;
}
private
Map
<
String
,
Object
>
submodelConnectionToMap
(
Element
element
)
{
Map
<
String
,
Object
>
result
=
new
TreeMap
<>();
result
.
put
(
"from"
,
super
.
createMinifiedSearchResult
(
element
));
Map
<
String
,
Object
>
to
=
new
TreeMap
<>();
to
.
put
(
"modelId"
,
element
.
getSubmodel
().
getSubmodel
().
getId
());
result
.
put
(
"to"
,
to
);
return
result
;
}
}
rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalRestImpl.java
View file @
477a3a8a
...
...
@@ -21,10 +21,10 @@ import lcsb.mapviewer.annotation.services.TaxonomyBackend;
import
lcsb.mapviewer.annotation.services.annotators.AnnotatorException
;
import
lcsb.mapviewer.annotation.services.dapi.ChemicalSearchException
;
import
lcsb.mapviewer.api.BaseRestImpl
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
import
lcsb.mapviewer.services.QueryException
;
import
lcsb.mapviewer.services.interfaces.IElementService
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/comments/CommentController.java
View file @
477a3a8a
...
...
@@ -19,6 +19,7 @@ import lcsb.mapviewer.api.*;
import
lcsb.mapviewer.common.Configuration
;
import
lcsb.mapviewer.model.security.PrivilegeType
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.services.QueryException
;
import
lcsb.mapviewer.services.interfaces.IUserService
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/comments/CommentRestImpl.java
View file @
477a3a8a
...
...
@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
lcsb.mapviewer.api.BaseRestImpl
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.common.Configuration
;
import
lcsb.mapviewer.common.geometry.PointTransformation
;
import
lcsb.mapviewer.model.Project
;
...
...
@@ -21,6 +20,7 @@ import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
import
lcsb.mapviewer.model.map.reaction.Reaction
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.persist.dao.map.ReactionDao
;
import
lcsb.mapviewer.persist.dao.map.species.ElementDao
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/drugs/DrugRestImpl.java
View file @
477a3a8a
...
...
@@ -12,10 +12,10 @@ import lcsb.mapviewer.annotation.data.Drug;
import
lcsb.mapviewer.annotation.services.DrugSearchException
;
import
lcsb.mapviewer.annotation.services.TaxonomyBackend
;
import
lcsb.mapviewer.api.BaseRestImpl
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
import
lcsb.mapviewer.services.QueryException
;
import
lcsb.mapviewer.services.interfaces.IElementService
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/mirnas/MiRnaRestImpl.java
View file @
477a3a8a
...
...
@@ -12,10 +12,10 @@ import lcsb.mapviewer.annotation.data.MiRNA;
import
lcsb.mapviewer.annotation.services.MiRNASearchException
;
import
lcsb.mapviewer.annotation.services.TaxonomyBackend
;
import
lcsb.mapviewer.api.BaseRestImpl
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
import
lcsb.mapviewer.services.QueryException
;
import
lcsb.mapviewer.services.interfaces.IElementService
;
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java
View file @
477a3a8a
...
...
@@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
lcsb.mapviewer.api.BaseRestImpl
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.common.Pair
;
import
lcsb.mapviewer.common.geometry.ColorParser
;
import
lcsb.mapviewer.model.Project
;
...
...
@@ -24,6 +23,7 @@ import lcsb.mapviewer.model.map.reaction.Reaction;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.model.overlay.*
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.persist.dao.cache.UploadedFileEntryDao
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
import
lcsb.mapviewer.services.QueryException
;
...
...
rest-api/src/test/java/lcsb/mapviewer/api/projects/AllProjectTests.java
View file @
477a3a8a
...
...
@@ -18,7 +18,7 @@ import lcsb.mapviewer.api.projects.overlays.OverlayRestImplTest;
AllMiRnaTests
.
class
,
AllModelsTests
.
class
,
OverlayRestImplTest
.
class
,
Project
RestImpl
Test
.
class
})
Project
Controller
Test
.
class
})
public
class
AllProjectTests
{
}
rest-api/src/test/java/lcsb/mapviewer/api/projects/ProjectRestImplTest.java
deleted
100644 → 0
View file @
566a859b
package
lcsb.mapviewer.api.projects
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.util.Map
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.mockito.Mockito
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.google.gson.Gson
;
import
lcsb.mapviewer.api.RestTestFunctions
;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.ProjectLogEntry
;
import
lcsb.mapviewer.model.ProjectLogEntryType
;
import
lcsb.mapviewer.model.map.MiriamType
;
import
lcsb.mapviewer.model.map.model.Model
;
import
lcsb.mapviewer.persist.dao.ProjectDao
;
import
lcsb.mapviewer.persist.dao.user.UserDao
;
import
lcsb.mapviewer.services.ObjectNotFoundException
;
import
lcsb.mapviewer.services.interfaces.IModelService
;
import
lcsb.mapviewer.services.interfaces.IProjectService
;
public
class
ProjectRestImplTest
extends
RestTestFunctions
{
Logger
logger
=
LogManager
.
getLogger
();
@Autowired
ProjectRestImpl
_projectRest
;
ProjectRestImpl
projectRest
;
@Autowired
IModelService
modelService
;
@Autowired
IProjectService
projectService
;
@Autowired
ProjectDao
projectDao
;
@Autowired
UserDao
userDao
;
@Before
public
void
before
()
{
projectRest
=
_projectRest
;
}
@Test
(
expected
=
ObjectNotFoundException
.
class
)
public
void
testGetInvalidMetaData
()
throws
Exception
{
projectRest
.
getProject
(
"unknown_model_id"
);
}
private
void
createMockProjectRest
(
String
string
)
throws
Exception
{
Model
model
=
null
;
Project
project
=
null
;
model
=
super
.
getModelForFile
(
string
,
false
);
project
=
new
Project
(
model
.
getName
());
project
.
addModel
(
model
);
project
.
setOwner
(
userDao
.
getUserByLogin
(
ADMIN_BUILT_IN_LOGIN
));
project
.
setProjectId
(
model
.
getName
());
ProjectLogEntry
entry
=
new
ProjectLogEntry
();
entry
.
setContent
(
"content"
);
entry
.
setType
(
ProjectLogEntryType
.
OTHER
);
entry
.
setSeverity
(
"DEBUG"
);
project
.
addLogEntry
(
entry
);
projectDao
.
add
(
project
);
projectRest
=
Mockito
.
spy
(
_projectRest
);
}
}
service/src/main/java/lcsb/mapviewer/services/impl/ElementService.java
View file @
477a3a8a
...
...
@@ -2,6 +2,7 @@ package lcsb.mapviewer.services.impl;
import
java.util.*
;
import
org.hibernate.Hibernate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
...
...
@@ -82,4 +83,16 @@ public class ElementService implements IElementService {
return
elementAnnotations
;
}
@Override
public
List
<
Element
>
getElementsByFilter
(
Map
<
ElementProperty
,
List
<?
extends
Object
>>
properties
,
boolean
initializeLazy
)
{
List
<
Element
>
result
=
getElementsByFilter
(
properties
);
if
(
initializeLazy
)
{
for
(
Element
element
:
result
)
{
Hibernate
.
initialize
(
element
.
getSubmodel
().
getSubmodel
());
Hibernate
.
initialize
(
element
.
getModel
());
}
}
return
result
;
}
}
service/src/main/java/lcsb/mapviewer/services/interfaces/IElementService.java
View file @
477a3a8a
...
...
@@ -18,6 +18,8 @@ public interface IElementService {
Element
getElementById
(
String
projectId
,
int
mapId
,
int
elementId
)
throws
QueryException
;
List
<
Element
>
getElementsByFilter
(
Map
<
ElementProperty
,
List
<?
extends
Object
>>
properties
);
List
<
Element
>
getElementsByFilter
(
Map
<
ElementProperty
,
List
<?
extends
Object
>>
properties
,
boolean
initializeLazy
);
Map
<
MiriamType
,
Integer
>
getAnnotationStatistics
(
String
projectId
,
String
mapId
)
throws
QueryException
;
...
...
web/src/test/java/lcsb/mapviewer/web/CommentControllerIntegrationTest.java
View file @
477a3a8a
...
...
@@ -35,7 +35,6 @@ import org.springframework.test.web.servlet.RequestBuilder;
import
com.google.gson.JsonParser
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.api.projects.comments.CommentRestImpl
;
import
lcsb.mapviewer.common.Configuration
;
import
lcsb.mapviewer.model.Project
;
...
...
@@ -45,6 +44,7 @@ import lcsb.mapviewer.model.map.reaction.Reaction;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.model.security.PrivilegeType
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.persist.dao.map.CommentDao
;
import
lcsb.mapviewer.services.interfaces.ICommentService
;
import
lcsb.mapviewer.services.interfaces.IUserService
;
...
...
web/src/test/java/lcsb/mapviewer/web/ControllerIntegrationTest.java
View file @
477a3a8a
...
...
@@ -369,6 +369,7 @@ abstract public class ControllerIntegrationTest {
ModelSubmodelConnection
submodelConnection
=
new
ModelSubmodelConnection
(
submap
,
SubmodelType
.
UNKNOWN
);
map
.
addSubmodel
(
submodelConnection
);
element
.
setSubmodel
(
new
ElementSubmodelConnection
(
submap
,
SubmodelType
.
UNKNOWN
));
project
.
addModel
(
map
);
project
.
addModel
(
submap
);
...
...
web/src/test/java/lcsb/mapviewer/web/MapControllerIntegrationTest.java
View file @
477a3a8a
...
...
@@ -31,7 +31,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.gson.JsonParser
;
import
lcsb.mapviewer.api.ElementIdentifierType
;
import
lcsb.mapviewer.api.projects.models.bioEntities.elements.ElementsRestImpl
;
import
lcsb.mapviewer.api.projects.models.bioEntities.reactions.ReactionsRestImpl
;
import
lcsb.mapviewer.common.Configuration
;
...
...
@@ -47,6 +46,7 @@ import lcsb.mapviewer.model.overlay.DataOverlay;
import
lcsb.mapviewer.model.security.PrivilegeType
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.modelutils.map.ElementUtils
;
import
lcsb.mapviewer.modelutils.serializer.model.map.ElementIdentifierType
;
import
lcsb.mapviewer.services.interfaces.IUserService
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
...
...
web/src/test/java/lcsb/mapviewer/web/ProjectControllerIntegrationTest.java
View file @
477a3a8a
...
...
@@ -510,15 +510,22 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
@Test
public
void
testGetSubmapConnectionsForProject
()
throws
Exception
{
createProjectInSeparateThread
(
TEST_PROJECT
);
MockHttpSession
session
=
createSession
(
BUILT_IN_TEST_ADMIN_LOGIN
,
BUILT_IN_TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/api/projects/{projectId}/submapConnections/"
,
BUILT_IN
_PROJECT
).
session
(
session
);
RequestBuilder
request
=
get
(
"/api/projects/{projectId}/submapConnections/"
,
TEST
_PROJECT
).
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is2xxSuccessful
())
.
andDo
(
document
(
"projects/project_maps/get_connections"
,
projectPathParameters
(),
responseFields
(
fieldWithPath
(
"[]"
).
description
(
"list of connections"
).
type
(
"array"
))));
responseFields
(
fieldWithPath
(
"[]"
).
description
(
"list of connections"
).
type
(
JsonFieldType
.
ARRAY
),
fieldWithPath
(
"[].from.id"
).
description
(
"anchor bioEntity id"
).
type
(
JsonFieldType
.
NUMBER
),
fieldWithPath
(
"[].from.modelId"
).
description
(
"anchor map id"
).
type
(
JsonFieldType
.
NUMBER
),
fieldWithPath
(
"[].from.type"
).
description
(
"anchor type"
).
type
(
JsonFieldType
.
STRING
),
fieldWithPath
(
"[].to.modelId"
).
description
(
"destination map id"
).
type
(
JsonFieldType
.
NUMBER
))));
}
@Test
...
...
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