Commit 8dfc23ae authored by Noel Alonso's avatar Noel Alonso
Browse files

Permite enviar solo el id de relaciones

Tanto al añadir como al editar, el cliente envía solo el id de las
relaciones de themeInspire y parent. Se debe permitir este
comportamiento haciendo posible el envío de estas relaciones solo con el
identificador (esquema avro)

Adapta tests
parent 57b69407
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ public abstract class LayerCompactDTO extends LayerBaseDTO {

	@JsonDeserialize(using = CustomRelationDeserializer.class)
	@JsonSchemaUrl(value = "controller.mapping.THEME_INSPIRE")
	@Valid
	private ThemeInspireDTO themeInspire;

	@Valid
+1 −3
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ package es.redmic.atlaslib.dto.layerinfo;
 * #L%
 */

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import org.apache.avro.Schema;
@@ -70,7 +69,6 @@ public class LayerInfoDTO extends LayerCompactDTO {
	@NotNull
	@JsonDeserialize(using = CustomRelationDeserializer.class)
	@JsonSchemaUrl(value = "controller.mapping.CATEGORY")
	@Valid
	CategoryDTO parent;

	public CategoryDTO getParent() {
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ public class ThemeInspireDTO extends DomainDTO {
	@JsonIgnore
	public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse(
		"{\"type\":\"record\",\"name\":\"ThemeInspireDTO\",\"namespace\":\"es.redmic.atlaslib.dto.themeinspire\",\"fields\":["
				+ "{\"name\":\"code\",\"type\":\"string\"},"
				+ "{\"name\":\"code\",\"type\":[\"string\", \"null\"]},"
				+ "{\"name\":\"name\",\"type\":[\"string\", \"null\"]},"
				+ "{\"name\":\"name_en\",\"type\":[\"string\", \"null\"]},"
				+ "{\"name\":\"id\",\"type\":\"string\"}]}");
+0 −8
Original line number Diff line number Diff line
@@ -103,14 +103,6 @@ public class LayerInfoCheckDTOValidationTest extends DTOBaseTest<LayerInfoDTO> {
		checkDTOHasError(dto, SIZE_MESSAGE_TEMPLATE);
	}

	@Test
	public void validationDTO_ReturnNotNullError_IfThemeInspireFieldIsNull() {

		dto.getThemeInspire().setName(null);

		checkDTOHasError(dto, NOT_NULL_MESSAGE_TEMPLATE);
	}

	@Test
	public void validationDTO_ReturnNotNullError_IfLatLonBoundsImageFieldIsNull() {