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
b114fef2
Commit
b114fef2
authored
Aug 22, 2019
by
Piotr Gawron
Browse files
test checking if returing list of functions properly handles undefined project id
parent
e17f1126
Changes
2
Hide whitespace changes
Inline
Side-by-side
web/src/test/java/lcsb/mapviewer/web/AllIntegrationTests.java
View file @
b114fef2
...
...
@@ -13,6 +13,7 @@ import org.junit.runners.Suite.SuiteClasses;
EndPointsInputValidationTests
.
class
,
FileControllerIntegrationTest
.
class
,
FileControllerIntegrationTestWithoutTransaction
.
class
,
FunctionControllerIntegrationTest
.
class
,
MapControllerIntegrationTest
.
class
,
MiRnaControllerIntegrationTest
.
class
,
OverlayControllerIntegrationTest
.
class
,
...
...
web/src/test/java/lcsb/mapviewer/web/FunctionControllerIntegrationTest.java
0 → 100644
View file @
b114fef2
package
lcsb.mapviewer.web
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
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
;
import
org.springframework.transaction.annotation.Transactional
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@Transactional
@Rollback
public
class
FunctionControllerIntegrationTest
extends
ControllerIntegrationTest
{
@Test
public
void
testGetFunctionListWithUndefinedProject
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_LOGIN
,
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/projects/*/models/*/functions/"
)
.
contentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isNotFound
());
}
@Test
public
void
testGetFunctionWithUndefinedProject
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_LOGIN
,
ControllerIntegrationTest
.
BUILT_IN_TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/projects/*/models/*/functions/1"
)
.
contentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isNotFound
());
}
}
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