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

Añade nueva excepción al crear mapping de elastic

parent 6884c3fa
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public enum ExceptionType implements ExceptionTypeItfc {
	ES_HISTOGRAM_INTERVAL_QUERY_ERROR(Constants.ES_HISTOGRAM_INTERVAL_QUERY_ERROR),
	ES_TERM_QUERY_ERROR(Constants.ES_TERM_QUERY_ERROR),
	ES_INSERT_DOCUMENT(Constants.ES_INSERT_DOCUMENT),
	ES_CREATE_MAPPING_ERROR(Constants.ES_CREATE_MAPPING_ERROR),
	
	// DTOs
	DTO_NOT_VALID(Constants.DTO_NOT_VALID),
@@ -186,6 +187,7 @@ public enum ExceptionType implements ExceptionTypeItfc {
			ES_HISTOGRAM_INTERVAL_QUERY_ERROR = "ESHistogramIntervalQueryError",
			ES_TERM_QUERY_ERROR = "ESTermQueryError",
			ES_INSERT_DOCUMENT = "ESInsertError",
			ES_CREATE_MAPPING_ERROR = "ESCreateMappingError",
			
			// DTOs
			DTO_NOT_VALID = "DTONotValidException",
+16 −0
Original line number Diff line number Diff line
package es.redmic.exception.elasticsearch;

import java.util.Arrays;

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

public class ESCreateMappingException extends InternalException {

	private static final long serialVersionUID = -204107526629212762L;

	public ESCreateMappingException(String index) {
		super(ExceptionType.ES_CREATE_MAPPING_ERROR);
		setFieldErrors(Arrays.asList(index));
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ ESBboxQueryError=Error. Impossible to perform the query by Bbox with the input p
ESHistogramIntervalQueryError=Error. The interval sent {0} does not match the set of supported intervals.
ESTermQueryError=Error. Term {0} with value {1} is not as expected.
ESInsertError=Error. Register with field {0} and value {1} already exists.
ESCreateMappingError=Error. Mapping for index {0} could not be created.

#Layer
LayerNotFound=Layer {0} does not exist in service {1}
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ ESBboxQueryError=Error. Imposible realizar la query por bbox con los par
ESHistogramIntervalQueryError=Error. El intervalo de agrupación enviado {0} no coincide con el conjunto de intervalos soportados
ESTermQueryError=Error. El término {0} con valor {1} no es el esperado.
ESInsertError=Error. El registro con campo {0} y valor {1} ya existe.
ESCreateMappingError=Error. El mapping para el índice {0} no se ha podido crear.

#Layer
LayerNotFound=La capa {0} no existe en el servicio {1}
+22 −0
Original line number Diff line number Diff line
package es.redmic.test.unit.exception.elasticsearch;

import java.io.IOException;
import java.util.Arrays;

import org.junit.Test;

import es.redmic.exception.common.ExceptionType;
import es.redmic.exception.elasticsearch.ESCreateMappingException;
import es.redmic.test.unit.exception.common.BaseExceptionTest;

public class ESCreateMappingExceptionTest extends BaseExceptionTest {

	@Test
	public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException {

		String index = "vessels";

		checkMessage(new ESCreateMappingException(index), ExceptionType.ES_CREATE_MAPPING_ERROR.toString(),
				Arrays.asList(index));
	}
}