Created
November 2, 2021 07:39
-
-
Save eliasnogueira/cfecfee8e1ac2db2279f66df2b03942d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostTest { | |
@Test | |
void postUsingObjectMapping() { | |
User user = new User("Elias", "Principal Engineer"); | |
given(). | |
contentType(ContentType.JSON). | |
body(user). | |
when(). | |
post("/users"). | |
then(). | |
statusCode(HttpStatus.SC_CREATED). | |
body( | |
"name", is(user.getNama()), | |
"job", is(user.getJob()), | |
"id", notNullValue(), | |
"createdAt", notNullValue() | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment