Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
ba9f92e7
Commit
ba9f92e7
authored
Mar 12, 2014
by
kozazz
Committed by
Dave Syer
Mar 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add validation test to ws sample
Fixes gh-481
parent
d82a728e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
MessageControllerWebTests.java
...ui/src/test/java/sample/ui/MessageControllerWebTests.java
+8
-0
pom.xml
spring-boot-samples/spring-boot-sample-websocket/pom.xml
+1
-1
No files found.
spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/MessageControllerWebTests.java
100644 → 100755
View file @
ba9f92e7
...
...
@@ -26,6 +26,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* A Basic Spring MVC Test for the Sample Controller"
*
* @author Biju Kunjummen
* @author Doo-Hwan, Kwak
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@WebAppConfiguration
...
...
@@ -55,6 +56,13 @@ public class MessageControllerWebTests {
.
andExpect
(
header
().
string
(
"location"
,
RegexMatcher
.
matches
(
"/[0-9]+"
)));
}
@Test
public
void
testCreateValidation
()
throws
Exception
{
this
.
mockMvc
.
perform
(
post
(
"/"
).
param
(
"text"
,
""
).
param
(
"summary"
,
""
))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
content
().
string
(
containsString
(
"is required"
)));
}
private
static
class
RegexMatcher
extends
TypeSafeMatcher
<
String
>
{
private
final
String
regex
;
...
...
spring-boot-samples/spring-boot-sample-websocket/pom.xml
100644 → 100755
View file @
ba9f92e7
...
...
@@ -2,7 +2,7 @@
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
spring-boot-sample-websocket
</artifactId>
<packaging>
w
ar
</packaging>
<packaging>
j
ar
</packaging>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>
org.springframework.boot
</groupId>
...
...
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