Commit 4d2b682f authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade settingsId como no null + tests

parent 5e553f01
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ public class PersistenceDTO extends SettingsBaseDTO {
	@JsonIgnore
	public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse(
		"{\"type\":\"record\",\"name\":\"PersistenceDTO\",\"namespace\":\"es.redmic.usersettingslib.dto\",\"fields\":["
			+ "{\"name\":\"settingsId\",\"type\":[\"string\", \"null\"]},"
			+ "{\"name\":\"settingsId\",\"type\":\"string\"},"
			+ "{\"name\":\"name\",\"type\":[\"string\", \"null\"]},"
			+ "{\"name\":\"shared\",\"type\":\"boolean\", \"default\": \"false\"},"
			+ "{\"name\":\"userId\",\"type\": \"string\"},"
@@ -54,6 +54,7 @@ public class PersistenceDTO extends SettingsBaseDTO {
		super();
	}

	@NotNull
	private String settingsId;

	private String name;
+8 −0
Original line number Diff line number Diff line
@@ -50,4 +50,12 @@ public class PersistenceCheckDTOValidationTest extends DTOBaseTest<PersistenceDT

		checkDTOHasError(dto, NOT_NULL_MESSAGE_TEMPLATE);
	}

	@Test
	public void validationDTO_ReturnError_IfSettingsIdIsNull() {

		dto.setSettingsId(null);

		checkDTOHasError(dto, NOT_NULL_MESSAGE_TEMPLATE);
	}
}
+2 −0
Original line number Diff line number Diff line
@@ -513,6 +513,8 @@ public abstract class SettingsDataUtil {

		PersistenceDTO persistence = new PersistenceDTO();

		persistence.setSettingsId(PREFIX + UUID.randomUUID().toString());

		persistence.setId(PREFIX + code);
		persistence.setName("prueba");
		persistence.setUserId(USER);