Skip to content

Commit

Permalink
Refatoração nos testes / assertivas
Browse files Browse the repository at this point in the history
  • Loading branch information
thinogueiras committed Mar 5, 2024
1 parent 04d97a5 commit 46fc36e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/test/java/br/qa/thinogueiras/tests/AccountTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public void shouldInsertAccount() {
.when()
.post("/contas")
.then()
.statusCode(201);
.statusCode(201)
.body("nome", is("Conta corrente"))
.body("visivel", is(true));
}

@Test
Expand Down
10 changes: 0 additions & 10 deletions src/test/java/br/qa/thinogueiras/tests/AuthTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,4 @@ public void shouldNotAccessTransacoesWithoutToken() {
.then()
.statusCode(401);
}

@Test
public void shouldNotAccessMovimentacoesWithoutToken() {

given()
.when()
.get("/movimentacoes")
.then()
.statusCode(401);
}
}
7 changes: 5 additions & 2 deletions src/test/java/br/qa/thinogueiras/tests/MovementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static br.qa.thinogueiras.utils.Utils.getValidMovement;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.aMapWithSize;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasSize;

Expand All @@ -26,7 +27,9 @@ public void shouldInsertAccountMovement() {
.when()
.post("/transacoes")
.then()
.statusCode(201);
.statusCode(201)
.body("$", aMapWithSize(13))
.body("valor", is("5000.00"));
}

@Test
Expand All @@ -50,7 +53,7 @@ public void shouldValidateRequiredFieldsInAccountMovementInsert() {
}

@Test
public void ShouldNotRegisterMovementWithFutureDate() {
public void shouldNotRegisterMovementWithFutureDate() {
Movement movement = getValidMovement();
movement.setData_transacao("13/11/2027");

Expand Down

0 comments on commit 46fc36e

Please sign in to comment.