From 8207c1773aa144793cb42ae37104a836a4df6df4 Mon Sep 17 00:00:00 2001 From: Dominic Rogetzer Date: Sun, 17 Jun 2018 16:59:12 +0200 Subject: Fix employee&vehicle-dao-tests to use correct alert headers [#25963] --- .../controller/CreateNewEmployeeControllerTest.java | 9 ++++++--- .../controller/CreateNewVehicleControllerTest.java | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewEmployeeControllerTest.java b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewEmployeeControllerTest.java index ea09fb7..3273593 100644 --- a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewEmployeeControllerTest.java +++ b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewEmployeeControllerTest.java @@ -1,5 +1,8 @@ package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller; +import static at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.Helper.ALERT_TITLE_SERVICE_EXCEPTION; +import static at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.Helper.ALERT_TITLE_SUCCESS; +import static at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.Helper.ALERT_TITLE_VALIDATION_ERROR; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; @@ -47,7 +50,7 @@ public class CreateNewEmployeeControllerTest extends HighDpiAwareApplicationTest Assert.assertNotNull(alertDialog); DialogPane dialogPane = (DialogPane) alertDialog.getScene().getRoot(); - Assert.assertEquals("Erfolgreich angelegt", dialogPane.getHeaderText()); + Assert.assertEquals(ALERT_TITLE_SUCCESS, dialogPane.getHeaderText()); } @Test @@ -62,7 +65,7 @@ public class CreateNewEmployeeControllerTest extends HighDpiAwareApplicationTest Assert.assertNotNull(alertDialog); DialogPane dialogPane = (DialogPane) alertDialog.getScene().getRoot(); - Assert.assertEquals("Ungültige Eingabe", dialogPane.getHeaderText()); + Assert.assertEquals(ALERT_TITLE_VALIDATION_ERROR, dialogPane.getHeaderText()); } @Test @@ -79,6 +82,6 @@ public class CreateNewEmployeeControllerTest extends HighDpiAwareApplicationTest Assert.assertNotNull(alertDialog); DialogPane dialogPane = (DialogPane) alertDialog.getScene().getRoot(); - Assert.assertEquals("Speicherfehler", dialogPane.getHeaderText()); + Assert.assertEquals(ALERT_TITLE_SERVICE_EXCEPTION, dialogPane.getHeaderText()); } } diff --git a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewVehicleControllerTest.java b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewVehicleControllerTest.java index 9e6c470..f5f4b57 100644 --- a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewVehicleControllerTest.java +++ b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateNewVehicleControllerTest.java @@ -1,5 +1,8 @@ package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller; +import static at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.Helper.ALERT_TITLE_SERVICE_EXCEPTION; +import static at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.Helper.ALERT_TITLE_SUCCESS; +import static at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.Helper.ALERT_TITLE_VALIDATION_ERROR; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; @@ -45,7 +48,7 @@ public class CreateNewVehicleControllerTest extends HighDpiAwareApplicationTest Assert.assertNotNull(alertDialog); DialogPane dialogPane = (DialogPane) alertDialog.getScene().getRoot(); - Assert.assertEquals("Speichern Erfolgreich", dialogPane.getHeaderText()); + Assert.assertEquals(ALERT_TITLE_SUCCESS, dialogPane.getHeaderText()); } @Test @@ -59,7 +62,7 @@ public class CreateNewVehicleControllerTest extends HighDpiAwareApplicationTest Assert.assertNotNull(alertDialog); DialogPane dialogPane = (DialogPane) alertDialog.getScene().getRoot(); - Assert.assertEquals("Ungültige Eingabe", dialogPane.getHeaderText()); + Assert.assertEquals(ALERT_TITLE_VALIDATION_ERROR, dialogPane.getHeaderText()); } @Test @@ -73,6 +76,6 @@ public class CreateNewVehicleControllerTest extends HighDpiAwareApplicationTest Assert.assertNotNull(alertDialog); DialogPane dialogPane = (DialogPane) alertDialog.getScene().getRoot(); - Assert.assertEquals("Fehler", dialogPane.getHeaderText()); + Assert.assertEquals(ALERT_TITLE_SERVICE_EXCEPTION, dialogPane.getHeaderText()); } } -- cgit v1.2.3-70-g09d2