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
cc336996
Commit
cc336996
authored
Aug 22, 2019
by
Piotr Gawron
Browse files
test checking if undefined project is proper handled when listing elements
parent
1554a8c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
web/src/test/java/lcsb/mapviewer/web/CommentControllerIntegrationTestWithoutTransaction.java
View file @
cc336996
...
...
@@ -16,8 +16,6 @@ import org.springframework.test.web.servlet.RequestBuilder;
@Rollback
public
class
CommentControllerIntegrationTestWithoutTransaction
extends
ControllerIntegrationTest
{
private
static
final
String
BUILT_IN_TEST_ADMIN_PASSWORD
=
"admin"
;
private
static
final
String
BUILT_IN_TEST_ADMIN_LOGIN
=
"admin"
;
Logger
logger
=
LogManager
.
getLogger
();
@Before
...
...
web/src/test/java/lcsb/mapviewer/web/ControllerIntegrationTest.java
View file @
cc336996
...
...
@@ -51,6 +51,9 @@ import lcsb.mapviewer.web.config.SpringWebConfig;
@ContextConfiguration
(
classes
=
SpringWebConfig
.
class
)
abstract
public
class
ControllerIntegrationTest
{
protected
static
final
String
BUILT_IN_TEST_ADMIN_PASSWORD
=
"admin"
;
protected
static
final
String
BUILT_IN_TEST_ADMIN_LOGIN
=
"admin"
;
@Rule
public
UnitTestFailedWatcher
unitTestFailedWatcher
=
new
UnitTestFailedWatcher
();
protected
MockMvc
mockMvc
;
...
...
web/src/test/java/lcsb/mapviewer/web/MapControllerIntegrationTest.java
View file @
cc336996
...
...
@@ -11,6 +11,7 @@ import org.junit.*;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.mock.web.MockHttpSession
;
import
org.springframework.test.annotation.Rollback
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.web.servlet.RequestBuilder
;
...
...
@@ -76,6 +77,19 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
assertTrue
(
"user should be able to access elements"
,
elements
>
0
);
}
@Test
public
void
testGetAllElementsForUndefinedProject
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_LOGIN
,
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/projects/*/models/*/bioEntities/elements/"
)
.
contentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isNotFound
());
}
@Test
public
void
testSearchBioEntitiesAsAnonymous
()
throws
Exception
{
userService
.
grantUserPrivilege
(
anonymous
,
PrivilegeType
.
READ_PROJECT
,
project
.
getProjectId
());
...
...
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