Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ea07148

Browse files
[improve] Improved a few test names, added a few 'given' states
1 parent b9f59ff commit ea07148

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎d03/d03s03-unit-and-integration-testing/src/test/java/net/safedata/spring/training/d03s03/ProductControllerTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public void initializeProduct() {
4949
}
5050

5151
@Test
52-
public void shouldGetAProductById() {
52+
public void givenTheContentTypeIsCorrect_WhenGettingAProduct_ThenAllGood() {
53+
given()
54+
.accept(ContentType.JSON).
5355
when()
5456
.get("/product/{id}", 1).
5557
then()
@@ -71,7 +73,9 @@ public void givenTheContentTypeIsCorrect_WhenGettingAllProducts_ThenAllGood() {
7173

7274
// a sample of using a dataProvider
7375
@Test(dataProvider = "dataProvider")
74-
public void shouldGetAllProducts(final String productId, final int statusCode) {
76+
public void givenTheContentTypeIsCorrect_WhenUsingADataProvider_ThenAllGood(final String productId, final int statusCode) {
77+
given()
78+
.accept(ContentType.JSON).
7579
when()
7680
.get("/product/{id}", productId).
7781
then()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /