Merge branch 'tests' into 'dev'

Reorganized tests

See merge request sa4-2020/the-sanmarinoes/backend!156
This commit is contained in:
Claudio Maggioni 2020-05-19 19:39:25 +02:00
commit 9f03f75bcb
41 changed files with 41 additions and 52 deletions

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.SceneSaveRequest;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Icon; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Icon;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;

View file

@ -1,9 +1,8 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
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 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; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Sensor;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.SwitchOperationRequest;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.SwitchableSaveRequest;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.SwitchableStateSaveRequest;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.ThermostatConditionSaveRequest;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Thermostat; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Thermostat;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.ThermostatCondition; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.ThermostatCondition;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.ThermostatSaveRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.UserRegistrationRequest;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.dto;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.UserResponse;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.User; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.User;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;

View file

@ -1,8 +1,7 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.error;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import ch.usi.inf.sa4.sanmarinoes.smarthut.error.*;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.model;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;

View file

@ -1,4 +1,4 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut; package ch.usi.inf.sa4.sanmarinoes.smarthut.utils;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -6,7 +6,6 @@ import static org.mockito.Mockito.when;
import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException; import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.User; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.User;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.UserRepository; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.UserRepository;
import ch.usi.inf.sa4.sanmarinoes.smarthut.utils.Utils;
import java.security.Principal; import java.security.Principal;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;