Created
March 10, 2016 12:05
-
-
Save brunokrebs/93b1e492ff585d064591 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
package br.com.brunokrebs; | |
import br.com.brunokrebs.model.User; | |
import com.jayway.restassured.http.ContentType; | |
import org.junit.FixMethodOrder; | |
import org.junit.Test; | |
import org.junit.runners.MethodSorters; | |
import org.springframework.http.HttpStatus; | |
import static com.jayway.restassured.RestAssured.given; | |
import static org.hamcrest.Matchers.equalTo; | |
@FixMethodOrder(MethodSorters.NAME_ASCENDING) | |
public class UserRestIT { | |
private static final String USER_ENDPOINT = "/users/"; | |
@Test | |
public void test1CreateUser() { | |
User user = new User("Bruno Krebs", "brunokrebs@spam4.me", "bestpasswordever"); | |
given().contentType(ContentType.JSON).body(user) | |
.when().post(USER_ENDPOINT).then() | |
.assertThat().statusCode(equalTo(HttpStatus.OK.value())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment