fixed sensorsaverequest

This commit is contained in:
Jacob Salvi 2020-05-18 11:58:33 +02:00
parent be5ab5b4b3
commit 266fc3af9e

View file

@ -1,6 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut;
import static org.junit.jupiter.api.Assertions.assertEquals; 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.dto.SensorSaveRequest;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Sensor; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Sensor;
@ -26,6 +27,17 @@ public class SensorSaveRequestTests {
assertEquals(42L, sensor.getRoomId()); 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 @Test
@DisplayName("test setName") @DisplayName("test setName")
public void testSetName() { public void testSetName() {