Commit ec25e128 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade excepción imposibilidad de borrar settings

parent f6c1630c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -141,7 +141,8 @@ public enum ExceptionType implements ExceptionTypeItfc {
	SELECTION_CHANGE_NOT_ALLOWED(Constants.SELECTION_CHANGE_NOT_ALLOWED),
	SETTINGS_TO_CLONE_NOT_FOUND_EXCEPTION(Constants.SETTINGS_TO_CLONE_NOT_FOUND_EXCEPTION),
	SETTINGS_TO_SAVE_NOT_FOUND_EXCEPTION(Constants.SETTINGS_TO_SAVE_NOT_FOUND_EXCEPTION),
	SETTINGS_CHANGE_FORBIDDEN(Constants.SETTINGS_CHANGE_FORBIDDEN_EXCEPTION);
	SETTINGS_CHANGE_FORBIDDEN(Constants.SETTINGS_CHANGE_FORBIDDEN_EXCEPTION),
	DELETE_SETTINGS_NOT_ALLOWED(Constants.DELETE_SETTINGS_NOT_ALLOWED);
	
	// @formatter:on

@@ -287,7 +288,8 @@ public enum ExceptionType implements ExceptionTypeItfc {
			SELECTION_CHANGE_NOT_ALLOWED = "SelectionChangeNotAllowedException",
			SETTINGS_TO_CLONE_NOT_FOUND_EXCEPTION = "SettingsToCloneNotFoundException",
			SETTINGS_TO_SAVE_NOT_FOUND_EXCEPTION = "SettingsToSaveNotFoundException",
			SETTINGS_CHANGE_FORBIDDEN_EXCEPTION = "SettingsChangeForbiddenException";
			SETTINGS_CHANGE_FORBIDDEN_EXCEPTION = "SettingsChangeForbiddenException",
			DELETE_SETTINGS_NOT_ALLOWED = "DeleteSettingsNotAllowedException";
		// @formatter:on
	}

+33 −0
Original line number Diff line number Diff line
package es.redmic.exception.settings;

/*-
 * #%L
 * Exceptions
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

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

public class DeleteSettingsNotAllowedException extends MethodNotAllowedException {

	private static final long serialVersionUID = 1L;

	public DeleteSettingsNotAllowedException() {
		super(ExceptionType.DELETE_SETTINGS_NOT_ALLOWED);
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -115,3 +115,4 @@ SelectionChangeNotAllowedException=Error. Selection could not be changed. Try ag
SettingsToCloneNotFoundException=Error. It is not possible to retrieve the configuration. It may not exist or be accessible.
SettingsToSaveNotFoundException=Error. It is not possible to save your settings. It may not be accessible.
SettingsChangeForbiddenException=Error. You cannot change the configuration because you do not have sufficient privileges.
DeleteSettingsNotAllowedException=Error. Setting is shared with other users and cannot be deleted.
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -115,3 +115,4 @@ SelectionChangeNotAllowedException=Error. No se ha podido cambiar la selecci
SettingsToCloneNotFoundException=Error. No es posible recuperar la configuración especificada. Es posible que no exista o no esté accesible.
SettingsToSaveNotFoundException=Error. No es posible guardar su configuración. Es posible que no esté accesible.
SettingsChangeForbiddenException=Error. No es posible cambiar la configuración debido a que no tiene privilegios suficientes.
DeleteSettingsNotAllowedException=Error. Esta configuración está compartida con otros usuarios y no puede ser eliminada.
 No newline at end of file
+39 −0
Original line number Diff line number Diff line
package es.redmic.test.unit.exception.settings;

/*-
 * #%L
 * Exceptions
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.io.IOException;

import org.junit.Test;

import es.redmic.exception.common.ExceptionType;
import es.redmic.exception.settings.DeleteSettingsNotAllowedException;
import es.redmic.test.unit.exception.common.BaseExceptionTest;

public class DeleteSettingsNotAllowedExceptionTest extends BaseExceptionTest {

	@Test
	public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException {

		checkMessage(new DeleteSettingsNotAllowedException(), ExceptionType.DELETE_SETTINGS_NOT_ALLOWED.toString(),
				null);
	}
}