diff options
author | Viktoria Pundy <viktoria.pundy@aon.at> | 2018-05-05 20:47:39 +0200 |
---|---|---|
committer | Viktoria Pundy <viktoria.pundy@aon.at> | 2018-05-06 18:12:35 +0200 |
commit | e385422b562f0614209f4a71f011f7cf85753fe4 (patch) | |
tree | b4c0d61585b303ceaa683281fab681138272c3ef /src/test | |
parent | 23bd53d2664fc68e6cdbf0e8f317d2354286f5a1 (diff) | |
download | sepm-groupproject-e385422b562f0614209f4a71f011f7cf85753fe4.tar.gz sepm-groupproject-e385422b562f0614209f4a71f011f7cf85753fe4.tar.xz sepm-groupproject-e385422b562f0614209f4a71f011f7cf85753fe4.zip |
Mocked H2
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/at/ac/tuwien/sepm/assignment/groupphase/operation/OperationServiceComponentTest.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/at/ac/tuwien/sepm/assignment/groupphase/operation/OperationServiceComponentTest.java b/src/test/at/ac/tuwien/sepm/assignment/groupphase/operation/OperationServiceComponentTest.java index fc3ea54..aeee11f 100644 --- a/src/test/at/ac/tuwien/sepm/assignment/groupphase/operation/OperationServiceComponentTest.java +++ b/src/test/at/ac/tuwien/sepm/assignment/groupphase/operation/OperationServiceComponentTest.java @@ -17,7 +17,6 @@ import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Vehicle.Veh import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.OperationService; import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.OperationServiceImpl; import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidOperationException; -import at.ac.tuwien.sepm.assignment.groupphase.exception.PersistenceException; import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException; import at.ac.tuwien.sepm.assignment.groupphase.util.JDBCConnectionManager; import java.time.Instant; @@ -27,12 +26,11 @@ import org.junit.Test; public class OperationServiceComponentTest { - private final OperationDAO operationDAO = new DBOperationDAO(new JDBCConnectionManager()); + private final OperationDAO operationDAO = new DBOperationDAO(new JDBCConnectionManager("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1")); private final OperationService operationService = new OperationServiceImpl(operationDAO); @Test public void addOperationTest() { - //TODO: MOCK H2 Vehicle vehicle = Vehicle.builder() .status(Vehicle.Status.FREI_FUNK) @@ -53,6 +51,7 @@ public class OperationServiceComponentTest { .vehicles(List.of(vehicle)) .build(); try { + //TODO: OPERATION DOES NOT WORK Assert.assertThat(operationService.add(operation), is(1L)); } catch (InvalidOperationException | ServiceException e) { fail(); |