diff --git a/README.md b/README.md index c005f66..c3d1f80 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,8 @@ src/ ├── util/ # Utility classes └── exception/ # Standard framework exceptions resources/ - └── config.properties # Default project properties file + └── config/ + └── config.properties # Default project properties file ``` ## Example Tests diff --git a/pom.xml b/pom.xml index 6bd13b8..cfe8703 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.felseje java-api-test-automation-framework - 1.0.0 + 1.1.0 1.0.12 diff --git a/src/main/java/io/github/felseje/apitestautomation/client/login/LoginClient.java b/src/main/java/io/github/felseje/apitestautomation/client/login/LoginClient.java new file mode 100644 index 0000000..8d1138d --- /dev/null +++ b/src/main/java/io/github/felseje/apitestautomation/client/login/LoginClient.java @@ -0,0 +1,19 @@ +package io.github.felseje.apitestautomation.client.login; + +import io.github.felseje.apitestautomation.client.login.dto.request.LoginRequest; +import io.github.felseje.apitestautomation.core.client.AbstractClient; +import io.github.felseje.apitestautomation.core.request.RequestContext; +import io.restassured.http.ContentType; +import io.restassured.response.Response; + +public class LoginClient extends AbstractClient { + + public Response login(LoginRequest request) { + RequestContext context = RequestContext.builder() + .body(request) + .contentType(ContentType.JSON) + .build(); + return post(context, "/login"); + } + +} diff --git a/src/main/java/io/github/felseje/apitestautomation/client/login/dto/request/LoginRequest.java b/src/main/java/io/github/felseje/apitestautomation/client/login/dto/request/LoginRequest.java new file mode 100644 index 0000000..c81e1ed --- /dev/null +++ b/src/main/java/io/github/felseje/apitestautomation/client/login/dto/request/LoginRequest.java @@ -0,0 +1,15 @@ +package io.github.felseje.apitestautomation.client.login.dto.request; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class LoginRequest { + + private String email; + private String password; + +} diff --git a/src/main/java/io/github/felseje/apitestautomation/client/login/dto/response/LoginResponse.java b/src/main/java/io/github/felseje/apitestautomation/client/login/dto/response/LoginResponse.java new file mode 100644 index 0000000..3752a21 --- /dev/null +++ b/src/main/java/io/github/felseje/apitestautomation/client/login/dto/response/LoginResponse.java @@ -0,0 +1,15 @@ +package io.github.felseje.apitestautomation.client.login.dto.response; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class LoginResponse { + + private String message; + private String authorization; + +} diff --git a/src/main/java/io/github/felseje/apitestautomation/core/request/RequestCall.java b/src/main/java/io/github/felseje/apitestautomation/core/request/ApiRequest.java similarity index 61% rename from src/main/java/io/github/felseje/apitestautomation/core/request/RequestCall.java rename to src/main/java/io/github/felseje/apitestautomation/core/request/ApiRequest.java index 39489d7..566b7c1 100644 --- a/src/main/java/io/github/felseje/apitestautomation/core/request/RequestCall.java +++ b/src/main/java/io/github/felseje/apitestautomation/core/request/ApiRequest.java @@ -1,20 +1,20 @@ package io.github.felseje.apitestautomation.core.request; -import io.github.felseje.apitestautomation.core.response.ResponseContext; +import io.github.felseje.apitestautomation.core.response.ApiResponse; import io.github.felseje.apitestautomation.util.ArgumentValidator; import java.util.function.Supplier; -public class RequestCall { +public class ApiRequest { - private final Supplier action; + private final Supplier action; - public RequestCall(Supplier action) { + public ApiRequest(Supplier action) { ArgumentValidator.requireNotNull(action, "The 'action' cannot be null"); this.action = action; } - public ResponseContext execute() { + public ApiResponse execute() { return action.get(); } diff --git a/src/main/java/io/github/felseje/apitestautomation/core/request/RetryRequest.java b/src/main/java/io/github/felseje/apitestautomation/core/request/RetryRequest.java index 19af22f..407a91a 100644 --- a/src/main/java/io/github/felseje/apitestautomation/core/request/RetryRequest.java +++ b/src/main/java/io/github/felseje/apitestautomation/core/request/RetryRequest.java @@ -1,6 +1,6 @@ package io.github.felseje.apitestautomation.core.request; -import io.github.felseje.apitestautomation.core.response.ResponseContext; +import io.github.felseje.apitestautomation.core.response.ApiResponse; import io.github.felseje.apitestautomation.util.ArgumentValidator; import org.awaitility.Awaitility; @@ -14,14 +14,14 @@ public class RetryRequest { private static final String NULL_TIME_UNIT_ERROR = "The 'unit' cannot be null"; - private final Supplier action; + private final Supplier action; private Duration timeout = Duration.ofSeconds(10); private Duration poll = Duration.ofMillis(500); private RetryStrategy strategy = RetryStrategy.AT_MOST; private Duration minDuration; private Duration maxDuration; - public RetryRequest(Supplier action) { + public RetryRequest(Supplier action) { ArgumentValidator.requireNotNull(action, "The 'action' cannot be null"); this.action = action; } @@ -55,16 +55,16 @@ public RetryRequest pollEvery(long time, TimeUnit unit) { return this; } - public ResponseContext until(Predicate condition) { + public ApiResponse until(Predicate condition) { ArgumentValidator.requireNotNull(condition, "The 'condition' cannot be null"); - AtomicReference last = new AtomicReference<>(); + AtomicReference last = new AtomicReference<>(); switch (strategy) { case AT_MOST -> Awaitility.await() .atMost(timeout) .pollInterval(poll) .ignoreExceptions() .until(() -> { - ResponseContext response = action.get(); + ApiResponse response = action.get(); last.set(response); return condition.test(response); }); @@ -74,7 +74,7 @@ public ResponseContext until(Predicate condition) { .pollInterval(poll) .ignoreExceptions() .until(() -> { - ResponseContext response = action.get(); + ApiResponse response = action.get(); last.set(response); return condition.test(response); }); @@ -85,7 +85,7 @@ public ResponseContext until(Predicate condition) { .pollInterval(poll) .ignoreExceptions() .until(() -> { - ResponseContext response = action.get(); + ApiResponse response = action.get(); last.set(response); return condition.test(response); }); diff --git a/src/main/java/io/github/felseje/apitestautomation/core/response/ApiResponse.java b/src/main/java/io/github/felseje/apitestautomation/core/response/ApiResponse.java new file mode 100644 index 0000000..ea525b3 --- /dev/null +++ b/src/main/java/io/github/felseje/apitestautomation/core/response/ApiResponse.java @@ -0,0 +1,155 @@ +package io.github.felseje.apitestautomation.core.response; + +import io.github.felseje.apitestautomation.util.ArgumentValidator; +import io.restassured.common.mapper.TypeRef; +import io.restassured.module.jsv.JsonSchemaValidator; +import io.restassured.response.Response; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +import static org.apache.http.HttpStatus.*; +import static org.hamcrest.Matchers.*; + +@RequiredArgsConstructor +public class ApiResponse { + + private static final int SC_TOO_MANY_REQUESTS = 429; + private final Response response; + + public ApiResponse shouldHaveStatus(int expectedStatusCode) { + response.then() + .assertThat() + .statusCode(expectedStatusCode); + return this; + } + + public ApiResponse shouldBeOk() { + return shouldHaveStatus(SC_OK); + } + + public ApiResponse shouldBeCreated() { + return shouldHaveStatus(SC_CREATED); + } + + public ApiResponse shouldBeAccepted() { + return shouldHaveStatus(SC_ACCEPTED); + } + + public ApiResponse shouldBeNoContent() { + return shouldHaveStatus(SC_NO_CONTENT); + } + + public ApiResponse shouldBeBadRequest() { + return shouldHaveStatus(SC_BAD_REQUEST); + } + + public ApiResponse shouldBeUnauthorized() { + return shouldHaveStatus(SC_UNAUTHORIZED); + } + + public ApiResponse shouldBeForbidden() { + return shouldHaveStatus(SC_FORBIDDEN); + } + + public ApiResponse shouldBeNotFound() { + return shouldHaveStatus(SC_NOT_FOUND); + } + + public ApiResponse shouldBeUnprocessableEntity() { + return shouldHaveStatus(SC_UNPROCESSABLE_ENTITY); + } + + public ApiResponse shouldBeTooManyRequests() { + return shouldHaveStatus(SC_TOO_MANY_REQUESTS); + } + + public ApiResponse shouldBeInternalServerError() { + return shouldHaveStatus(SC_INTERNAL_SERVER_ERROR); + } + + public ApiResponse shouldBeBadGateway() { + return shouldHaveStatus(SC_BAD_GATEWAY); + } + + public ApiResponse shouldBeServiceUnavailable() { + return shouldHaveStatus(SC_SERVICE_UNAVAILABLE); + } + + public ApiResponse shouldBeGatewayTimeout() { + return shouldHaveStatus(SC_GATEWAY_TIMEOUT); + } + + public ApiResponse shouldHaveJsonField(String path, Object value) { + ArgumentValidator.requireNotBlank(path, "Json path cannot be blank"); + response.then() + .assertThat() + .body(path, equalTo(value)); + return this; + } + + public ApiResponse shouldHaveHeader(String headerName, String expectedValue) { + ArgumentValidator.requireNotBlank(headerName, "Header name cannot be blank"); + ArgumentValidator.requireNotBlank(expectedValue, "Expected header value cannot be blank"); + response.then() + .assertThat() + .header(headerName, equalTo(expectedValue)); + return this; + } + + public ApiResponse shouldHaveHeaderContaining(String headerName, String expectedSubstring) { + ArgumentValidator.requireNotBlank(headerName, "Header name cannot be blank"); + ArgumentValidator.requireNotBlank(expectedSubstring, "Expected substring cannot be blank"); + response.then() + .assertThat() + .header(headerName, containsString(expectedSubstring)); + return this; + } + + public ApiResponse shouldHaveHeaderMatching(String headerName, String regex) { + ArgumentValidator.requireNotBlank(headerName, "Header name cannot be blank"); + ArgumentValidator.requireNotBlank(regex, "Regex cannot be blank"); + response.then() + .assertThat() + .header(headerName, matchesPattern(regex)); + return this; + } + + public ApiResponse shouldHaveXmlField(String xpath, String value) { + ArgumentValidator.requireNotBlank(xpath, "Xml path cannot be blank"); + response.then() + .assertThat() + .body(hasXPath(xpath, equalTo(value))); + return this; + } + + public ApiResponse shouldMatchJsonSchema(String schemaJson) { + ArgumentValidator.requireNotBlank(schemaJson, "Schema JSON cannot be blank"); + response.then() + .assertThat() + .body(JsonSchemaValidator.matchesJsonSchema(schemaJson)); + return this; + } + + public ApiResponse shouldMatchJsonSchemaInClasspath(String classpathResource) { + ArgumentValidator.requireNotBlank(classpathResource, "Classpath resource cannot be blank"); + response.then() + .assertThat() + .body(JsonSchemaValidator.matchesJsonSchemaInClasspath(classpathResource)); + return this; + } + + public Response raw() { + return response; + } + + public T as(Class clazz) { + return response.as(clazz); + } + + public List asList(Class clazz) { + return response.as(new TypeRef>() { + }); + } + +} diff --git a/src/main/java/io/github/felseje/apitestautomation/core/response/ResponseContext.java b/src/main/java/io/github/felseje/apitestautomation/core/response/ResponseContext.java deleted file mode 100644 index 1d109b1..0000000 --- a/src/main/java/io/github/felseje/apitestautomation/core/response/ResponseContext.java +++ /dev/null @@ -1,136 +0,0 @@ -package io.github.felseje.apitestautomation.core.response; - -import io.github.felseje.apitestautomation.util.ArgumentValidator; -import io.restassured.module.jsv.JsonSchemaValidator; -import io.restassured.response.Response; - -public class ResponseContext { - - private final Response response; - - public ResponseContext(Response response) { - ArgumentValidator.requireNotNull(response, "The 'response' cannot be null"); - this.response = response; - } - - public int statusCode() { - return response.getStatusCode(); - } - - public ResponseContext assertStatusCode(int expectedStatusCode) { - if (statusCode() != expectedStatusCode) { - String errorMessage = "Status code does not match the expected value. Actual: %d, Expected: %d." - .formatted(statusCode(), expectedStatusCode); - throw new AssertionError(errorMessage); - } - return this; - } - - public String header(String name) { - ArgumentValidator.requireNotBlank(name, "The header name cannot be blank"); - return response.getHeader(name); - } - - public ResponseContext assertHeader(String name, String expectedValue) { - String actual = header(name); - if (!expectedValue.equals(actual)) { - throw new AssertionError("Header '" + name + "' does not match. Actual: " + actual + ", Expected: " + expectedValue); - } - return this; - } - - public T as(Class clazz) { - ArgumentValidator.requireNotNull(clazz, "The 'clazz' cannot be null"); - return response.as(clazz); - } - - public String body() { - return response.getBody().asString(); - } - - public ResponseContext assertBodyEquals(String expectedBody) { - ArgumentValidator.requireNotNull(expectedBody, "Expected body cannot be null"); - if (!body().equals(expectedBody)) { - throw new AssertionError( - "Body does not match. Actual: " + body() + ", Expected: " + expectedBody - ); - } - return this; - } - - public ResponseContext assertBodyContains(String expectedFragment) { - ArgumentValidator.requireNotNull(expectedFragment, "Expected fragment cannot be null"); - if (!body().contains(expectedFragment)) { - throw new AssertionError( - "Body does not contain expected fragment. Actual: " + body() + ", Expected fragment: " + expectedFragment - ); - } - return this; - } - - public ResponseContext assertJsonSchema(String schemaJson) { - ArgumentValidator.requireNotBlank(schemaJson, "Schema JSON cannot be blank"); - try { - response.then().assertThat().body(JsonSchemaValidator.matchesJsonSchema(schemaJson)); - } catch (AssertionError e) { - throw new AssertionError("JSON Schema validation failed: " + e.getMessage(), e); - } - return this; - } - - public ResponseContext assertJsonSchemaInClasspath(String classpathResource) { - ArgumentValidator.requireNotBlank(classpathResource, "Classpath resource cannot be blank"); - try { - var matches = JsonSchemaValidator.matchesJsonSchemaInClasspath(classpathResource); - response.then() - .assertThat() - .body(matches); - } catch (AssertionError e) { - throw new AssertionError("JSON Schema validation failed for resource: " + classpathResource + ".", e); - } - return this; - } - - public Response getRawResponse() { - return response; - } - - public T path(String jsonPath) { - ArgumentValidator.requireNotBlank(jsonPath, "The 'jsonPath' cannot be blank"); - return response.jsonPath().get(jsonPath); - } - - public boolean jsonPathExists(String jsonPath) { - return path(jsonPath) != null; - } - - public boolean isSuccess() { - return statusCode() >= 200 && statusCode() < 300; - } - - public boolean isClientError() { - return statusCode() >= 400 && statusCode() < 500; - } - - public boolean isServerError() { - return statusCode() >= 500 && statusCode() < 600; - } - - public ResponseContext logBody() { - response.then().log().body(); - return this; - } - - public ResponseContext logAll() { - response.then().log().all(); - return this; - } - - public ResponseContext logIfError() { - if (statusCode() < 400) { - return this; - } - return logAll(); - } - -} diff --git a/src/main/java/io/github/felseje/apitestautomation/service/login/LoginService.java b/src/main/java/io/github/felseje/apitestautomation/service/login/LoginService.java new file mode 100644 index 0000000..533773b --- /dev/null +++ b/src/main/java/io/github/felseje/apitestautomation/service/login/LoginService.java @@ -0,0 +1,21 @@ +package io.github.felseje.apitestautomation.service.login; + +import io.github.felseje.apitestautomation.client.login.LoginClient; +import io.github.felseje.apitestautomation.client.login.dto.request.LoginRequest; +import io.github.felseje.apitestautomation.core.response.ApiResponse; +import io.github.felseje.apitestautomation.util.ArgumentValidator; +import io.restassured.response.Response; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public class LoginService { + + private final LoginClient loginClient; + + public ApiResponse login(LoginRequest request) { + ArgumentValidator.requireNotNull(request, "The login request cannot be null"); + Response response = loginClient.login(request); + return new ApiResponse(response); + } + +} diff --git a/src/main/resources/config.properties b/src/main/resources/config.properties deleted file mode 100644 index f784a01..0000000 --- a/src/main/resources/config.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Api url -base.url=https://api-link-here.com - -# Timeouts -http.connect.timeout=5000 -http.socket.timeout=10000 -http.connection-manager.timeout=10000 \ No newline at end of file diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties new file mode 100644 index 0000000..c7921f2 --- /dev/null +++ b/src/main/resources/config/config.properties @@ -0,0 +1,4 @@ +base.url=https://serverest.dev +http.connect.timeout=10000 +http.socket.timeout=15000 +http.connection-manager.timeout=15000 \ No newline at end of file diff --git a/src/test/java/io/github/felseje/apitestautomation/suite/FullTestSuite.java b/src/test/java/io/github/felseje/apitestautomation/suite/FullTestSuite.java new file mode 100644 index 0000000..9bf0aa3 --- /dev/null +++ b/src/test/java/io/github/felseje/apitestautomation/suite/FullTestSuite.java @@ -0,0 +1,14 @@ +package io.github.felseje.apitestautomation.suite; + +import io.github.felseje.apitestautomation.test.LoginIT; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.api.SuiteDisplayName; + +@Suite +@SuiteDisplayName("Full Test Suite") +@SelectClasses({ + LoginIT.class +}) +public class FullTestSuite { +} diff --git a/src/test/java/io/github/felseje/apitestautomation/test/LoginIT.java b/src/test/java/io/github/felseje/apitestautomation/test/LoginIT.java new file mode 100644 index 0000000..4bd902d --- /dev/null +++ b/src/test/java/io/github/felseje/apitestautomation/test/LoginIT.java @@ -0,0 +1,81 @@ +package io.github.felseje.apitestautomation.test; + +import io.github.felseje.apitestautomation.client.login.LoginClient; +import io.github.felseje.apitestautomation.client.login.dto.request.LoginRequest; +import io.github.felseje.apitestautomation.core.response.ApiResponse; +import io.github.felseje.apitestautomation.service.login.LoginService; +import io.github.felseje.apitestautomation.testdata.LoginProvider; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.stream.Stream; + +@Tag("login") +@DisplayName("Login Tests") +public class LoginIT { + + private static final String LOGIN_SUCCESS_SCHEMA = "schemas/login/success.json"; + private static final String LOGIN_UNAUTHORIZED_SCHEMA = "schemas/login/unauthorized.json"; + private static final String LOGIN_BLANK_EMAIL_SCHEMA = "schemas/login/blank-email.json"; + private static final String LOGIN_BLANK_PASSWORD_SCHEMA = "schemas/login/blank-password.json"; + private final LoginService loginService = new LoginService(new LoginClient()); + + static Stream provideBlankLoginFieldsForBadRequest() { + return Stream.of( + Arguments.of( + "Should return Bad Request when email is blank", + LOGIN_BLANK_EMAIL_SCHEMA, + LoginProvider.getLoginRequestWithBlankEmail() + ), + Arguments.of( + "Should return Bad Request when password is blank", + LOGIN_BLANK_PASSWORD_SCHEMA, + LoginProvider.getLoginRequestWithBlankPassword() + ) + ); + } + + @Test + @DisplayName("Should authenticate successfully when valid credentials are provided") + void shouldAuthenticateSuccessfully() { + // Arrange + LoginRequest request = LoginProvider.getValidLoginRequest(); + + // Act + ApiResponse response = loginService.login(request); + + // Assert + response.shouldBeOk() + .shouldMatchJsonSchemaInClasspath(LOGIN_SUCCESS_SCHEMA); + } + + @Test + @DisplayName("Should return unauthorized when invalid credentials are provided") + void shouldReturnUnauthorizedWhenCredentialsAreInvalid() { + // Arrange + LoginRequest request = LoginProvider.getLoginRequestWithUnauthorizedCredentials(); + + // Act + ApiResponse response = loginService.login(request); + + // Assert + response.shouldBeUnauthorized() + .shouldMatchJsonSchemaInClasspath(LOGIN_UNAUTHORIZED_SCHEMA); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("provideBlankLoginFieldsForBadRequest") + void shouldReturnBadRequestForBlankFields(String testName, String expectedSchema, LoginRequest request) { + // Act + ApiResponse response = loginService.login(request); + + // Assert + response.shouldBeBadRequest() + .shouldMatchJsonSchemaInClasspath(expectedSchema); + } + +} diff --git a/src/test/java/io/github/felseje/apitestautomation/testdata/LoginProvider.java b/src/test/java/io/github/felseje/apitestautomation/testdata/LoginProvider.java new file mode 100644 index 0000000..95b5f9e --- /dev/null +++ b/src/test/java/io/github/felseje/apitestautomation/testdata/LoginProvider.java @@ -0,0 +1,28 @@ +package io.github.felseje.apitestautomation.testdata; + +import io.github.felseje.apitestautomation.client.login.dto.request.LoginRequest; +import lombok.experimental.UtilityClass; + +@UtilityClass +public final class LoginProvider { + + private static final String VALID_EMAIL = "fulano@qa.com"; + private static final String VALID_PASSWORD = "teste"; + + public static LoginRequest getValidLoginRequest() { + return new LoginRequest(VALID_EMAIL, VALID_PASSWORD); + } + + public static LoginRequest getLoginRequestWithUnauthorizedCredentials() { + return new LoginRequest("unauth@mail.com", "p4ssw0rd"); + } + + public static LoginRequest getLoginRequestWithBlankEmail() { + return new LoginRequest("", "p4ssw0rd"); + } + + public static LoginRequest getLoginRequestWithBlankPassword() { + return new LoginRequest("rTyxUuv@qa.com", ""); + } + +} diff --git a/src/test/resources/schemas/login/blank-email.json b/src/test/resources/schemas/login/blank-email.json new file mode 100644 index 0000000..b5569eb --- /dev/null +++ b/src/test/resources/schemas/login/blank-email.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "required": [ + "email" + ], + "additionalProperties": false, + "properties": { + "email": { + "type": "string", + "const": "email não pode ficar em branco" + } + } +} \ No newline at end of file diff --git a/src/test/resources/schemas/login/blank-password.json b/src/test/resources/schemas/login/blank-password.json new file mode 100644 index 0000000..a25f85e --- /dev/null +++ b/src/test/resources/schemas/login/blank-password.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "required": [ + "password" + ], + "additionalProperties": false, + "properties": { + "password": { + "type": "string", + "const": "password não pode ficar em branco" + } + } +} \ No newline at end of file diff --git a/src/test/resources/schemas/login/success.json b/src/test/resources/schemas/login/success.json new file mode 100644 index 0000000..89c4fc5 --- /dev/null +++ b/src/test/resources/schemas/login/success.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "required": [ + "message", + "authorization" + ], + "properties": { + "message": { + "type": "string", + "const": "Login realizado com sucesso" + }, + "authorization": { + "type": "string", + "pattern": "^Bearer .*" + } + } +} \ No newline at end of file diff --git a/src/test/resources/schemas/login/unauthorized.json b/src/test/resources/schemas/login/unauthorized.json new file mode 100644 index 0000000..02278b3 --- /dev/null +++ b/src/test/resources/schemas/login/unauthorized.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "required": [ + "message" + ], + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + "const": "Email e/ou senha inválidos" + } + } +} \ No newline at end of file