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
c5add2ef
Commit
c5add2ef
authored
Feb 06, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use AssertJ in spring-boot-deployment-tests
See gh-5083
parent
e214fa09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
15 deletions
+12
-15
SampleGlassfishDeployApplicationIT.java
.../test/java/sample/SampleGlassfishDeployApplicationIT.java
+3
-3
SampleTomcatDeployApplicationIT.java
...src/test/java/sample/SampleTomcatDeployApplicationIT.java
+3
-4
SampleTomEEDeployApplicationIT.java
.../src/test/java/sample/SampleTomEEDeployApplicationIT.java
+3
-4
SampleWildFlyDeployApplicationIT.java
...rc/test/java/sample/SampleWildFlyDeployApplicationIT.java
+3
-4
No files found.
spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java
View file @
c5add2ef
...
...
@@ -22,7 +22,7 @@ import org.springframework.boot.test.TestRestTemplate;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Integration Tests for {@link SampleGlassfishDeployApplication}.
...
...
@@ -37,8 +37,8 @@ public class SampleGlassfishDeployApplicationIT {
System
.
out
.
println
(
url
);
ResponseEntity
<
String
>
entity
=
new
TestRestTemplate
().
getForEntity
(
url
,
String
.
class
);
assert
Equals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
()
);
assert
Equals
(
"Hello World"
,
entity
.
getBody
()
);
assert
That
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assert
That
(
entity
.
getBody
()).
isEqualTo
(
"Hello World"
);
}
}
spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java
View file @
c5add2ef
...
...
@@ -22,7 +22,7 @@ import org.springframework.boot.test.TestRestTemplate;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Integration Tests for {@link SampleTomcatDeployApplication}.
...
...
@@ -34,11 +34,10 @@ public class SampleTomcatDeployApplicationIT {
@Test
public
void
testHome
()
throws
Exception
{
String
url
=
"http://localhost:"
+
this
.
port
+
"/bootapp/"
;
System
.
out
.
println
(
url
);
ResponseEntity
<
String
>
entity
=
new
TestRestTemplate
().
getForEntity
(
url
,
String
.
class
);
assert
Equals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
()
);
assert
Equals
(
"Hello World"
,
entity
.
getBody
()
);
assert
That
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assert
That
(
entity
.
getBody
()).
isEqualTo
(
"Hello World"
);
}
}
spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java
View file @
c5add2ef
...
...
@@ -22,7 +22,7 @@ import org.springframework.boot.test.TestRestTemplate;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Integration Tests for {@link SampleTomEEDeployApplication}.
...
...
@@ -34,11 +34,10 @@ public class SampleTomEEDeployApplicationIT {
@Test
public
void
testHome
()
throws
Exception
{
String
url
=
"http://localhost:"
+
this
.
port
+
"/bootapp/"
;
System
.
out
.
println
(
url
);
ResponseEntity
<
String
>
entity
=
new
TestRestTemplate
().
getForEntity
(
url
,
String
.
class
);
assert
Equals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
()
);
assert
Equals
(
"Hello World"
,
entity
.
getBody
()
);
assert
That
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assert
That
(
entity
.
getBody
()).
isEqualTo
(
"Hello World"
);
}
}
spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java
View file @
c5add2ef
...
...
@@ -22,7 +22,7 @@ import org.springframework.boot.test.TestRestTemplate;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Integration Tests for {@link SampleWildFlyDeployApplication}.
...
...
@@ -34,11 +34,10 @@ public class SampleWildFlyDeployApplicationIT {
@Test
public
void
testHome
()
throws
Exception
{
String
url
=
"http://localhost:"
+
this
.
port
+
"/bootapp/"
;
System
.
out
.
println
(
url
);
ResponseEntity
<
String
>
entity
=
new
TestRestTemplate
().
getForEntity
(
url
,
String
.
class
);
assert
Equals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
()
);
assert
Equals
(
"Hello World"
,
entity
.
getBody
()
);
assert
That
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
assert
That
(
entity
.
getBody
()).
isEqualTo
(
"Hello World"
);
}
}
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