diff --git a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/SensorSaveRequestTests.java b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/SensorSaveRequestTests.java index 4409a38..7a219b1 100644 --- a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/SensorSaveRequestTests.java +++ b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/SensorSaveRequestTests.java @@ -1,6 +1,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.SensorSaveRequest; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Sensor; @@ -26,6 +27,17 @@ public class SensorSaveRequestTests { assertEquals(42L, sensor.getRoomId()); } + @Test + @DisplayName("test constructor") + public void testConstructorNotEmpty() { + SensorSaveRequest newSaveRequest = + new SensorSaveRequest(Sensor.SensorType.HUMIDITY, new BigDecimal(12), 12L, "name"); + assertNotNull(newSaveRequest.getSensor()); + assertNotNull(newSaveRequest.getName()); + assertNotNull(newSaveRequest.getRoomId()); + assertNotNull(newSaveRequest.getValue()); + } + @Test @DisplayName("test setName") public void testSetName() {