Commit 4679dbe7 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade excepción para recaptcha no válido

parent 524b36f5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ public enum ExceptionType implements ExceptionTypeItfc {
	PASSWORD_NOT_MATCH(Constants.PASSWORD_NOT_MATCH),
	RESET_PASSWORD_TIMEOUT(Constants.RESET_PASSWORD_TIMEOUT),
	TOKEN_NOT_FOUND(Constants.TOKEN_NOT_FOUND),
	RECAPTCHA_NOT_VALID(Constants.RECAPTCHA_NOT_VALID),
	
	// Security
	NOT_ALLOWED_EXCEPTION(Constants.NOT_ALLOWED_EXCEPTION),
@@ -160,6 +161,7 @@ public enum ExceptionType implements ExceptionTypeItfc {
			PASSWORD_NOT_MATCH = "PasswordNotMatch",
			RESET_PASSWORD_TIMEOUT = "ResetPasswordTimeOut",
			TOKEN_NOT_FOUND = "TokenNotFound",
			RECAPTCHA_NOT_VALID = "RecaptchaNotValid",

			// Security
			NOT_ALLOWED_EXCEPTION = "NotAllowedException",
+14 −0
Original line number Diff line number Diff line
package es.redmic.exception.user;

import es.redmic.exception.common.BadRequestException;
import es.redmic.exception.common.ExceptionType;

public class RecaptchaNotValidException extends BadRequestException {

	private static final long serialVersionUID = 6714485190161856195L;

	public RecaptchaNotValidException() {

		super(ExceptionType.RECAPTCHA_NOT_VALID);
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ ActivateAccountTimeOut=Error. Tiempo para activar la cuenta excedido.
PasswordNotMatch=Error. The password does not match the old one.
ResetPasswordTimeOut=Error. Time to change the password exceeded.
TokenNotFound=Error. Resource not accessible.
RecaptchaNotValid=Error. Recaptcha is'nt valid.

#Task
IngestPersistenceDataException=Error. The data could not be saved.
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ ActivateAccountTimeOut=Error. Tiempo para activar la cuenta excedido.
PasswordNotMatch=Error. La contraseña introducida no coincide con la antigua.
ResetPasswordTimeOut=Error. Tiempo para cambiar la contraseña excedido.
TokenNotFound=Error. Recurso no accesible.
RecaptchaNotValid=Error. El recaptcha no es válido.

#Task
IngestPersistenceDataException=Error. No se ha podido guardar los datos.
+18 −0
Original line number Diff line number Diff line
package es.redmic.test.unit.exception.user;

import java.io.IOException;

import org.junit.Test;

import es.redmic.exception.common.ExceptionType;
import es.redmic.exception.user.RecaptchaNotValidException;
import es.redmic.test.unit.exception.common.BaseExceptionTest;

public class RecaptchaNotValidExceptionTest extends BaseExceptionTest {

	@Test
	public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException {

		checkMessage(new RecaptchaNotValidException(), ExceptionType.RECAPTCHA_NOT_VALID.toString(), null);
	}
}