Commit 874420e8 authored by Noel Alonso's avatar Noel Alonso
Browse files

Cambia tipo genérico por específico en dto + test

parent 11254038
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.avro.Schema;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Polygon;

import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -113,7 +112,7 @@ public class LayerDTO extends LayerCompactDTO {
	private String image;

	@NotNull
	private Geometry geometry;
	private Polygon geometry;

	public String getTitle() {
		return title;
@@ -203,11 +202,11 @@ public class LayerDTO extends LayerCompactDTO {
		this.image = image;
	}

	public Geometry getGeometry() {
	public Polygon getGeometry() {
		return geometry;
	}

	public void setGeometry(Geometry geometry) {
	public void setGeometry(Polygon geometry) {
		this.geometry = geometry;
	}

+8 −2
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@ package es.redmic.atlaslib.unit.dto.layer;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.geotools.geometry.jts.JTSFactoryFinder;
import org.junit.Test;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;

import es.redmic.atlaslib.dto.layer.LayerDTO;
import es.redmic.atlaslib.unit.utils.LayerDataUtil;
@@ -247,7 +247,13 @@ public class LayerEqualTest {

		LayerDTO dto2 = LayerDataUtil.getLayer();

		dto1.setGeometry(new GeometryFactory().createPoint(new Coordinate(45.56433, 37.94388)));
		Coordinate[] coordinates = new Coordinate[] { new Coordinate(-18.1745567321777, 27.6111183166504),
				new Coordinate(-18.1745567321777, 29.4221172332764),
				new Coordinate(-13.5011913299561, 29.4221172332764),
				new Coordinate(-13.3011913299561, 27.6111183166504),
				new Coordinate(-18.1745567321777, 27.6111183166504) };

		dto1.setGeometry(JTSFactoryFinder.getGeometryFactory().createPolygon(coordinates));

		assertFalse(dto1.equals(dto2));
	}