Compare commits
7 Commits
6ac08e2db1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 00667d9e7d | |||
| 60390052dd | |||
|
|
0f23b15ad4 | ||
| 677336e534 | |||
| 342338f6e5 | |||
|
|
3050405792 | ||
| e667389694 |
40
README.md
40
README.md
@@ -1,2 +1,40 @@
|
||||
# Temp-Java-Gradle
|
||||
@Author Kevin Schoenmayer, Riley Schneider, Can Oezdemir, Lasse Grosshans
|
||||
|
||||
Volle Dokumentation mit Bildern, Vorbereitungen und Klassendiagramm unter
|
||||
https://docs.google.com/document/d/1iPl3XoZdvn1zqYCNlzHklEf_bRBGnQm41bAEaWz_s0w/edit?usp=sharing
|
||||
|
||||
|
||||
Voraussetzungen:
|
||||
Docker (inkl. Docker Compose)
|
||||
Java 17
|
||||
Git
|
||||
|
||||
Projekt bauen, testen und starten:
|
||||
|
||||
1. Projekt klonen:
|
||||
git clone https://home.luithardt.cloud:5400/KevinSchoenmayer/GseTDDUebungKCLR
|
||||
|
||||
2. Zu ...\GseTDDUebungKCLR\docker in cmd navigieren
|
||||
Docker starten:
|
||||
docker compose up -d
|
||||
|
||||
3. Tabellenerstellung fuer die Testumgebung:
|
||||
Verbinden Sie sich mit dem Programm Ihrer Wahl mit der Datenbank (z.B. HeidiSQL). Die Anmeldeinformationen finden Sie in der compose.yml-Datei.
|
||||
Fuehren Sie nun auf der Datenbank folgende SQL-Befehle aus dieser Dateien aus:
|
||||
resources\sql\createTaskTable.sql
|
||||
resources\sql\createWorkerTable.sql
|
||||
Sie sollten in Ihrer Datenbank nun zwei neue Tabellen sehen: Task und Worker. Wenn dem so sei, koennen Sie mit Punkt (6) fortfahren.
|
||||
|
||||
4. Projekt starten:
|
||||
gradle cleanRun --console=plain --quiet
|
||||
Jetzt werden die Tests durchgefuehrt und in
|
||||
...\GseTDDUebungKCLR\build\reports\tests\index.html
|
||||
gespeichert (genaue Adresse fuer .html wird automatisch angegeben),
|
||||
die Jacoco Test Coverage erzeugt und in
|
||||
...\GseTDDUebungKCLR\build\reports\jacoco\html\index.html
|
||||
gespeichert (genaue Adresse fuer .html wird automatisch angegeben),
|
||||
und das Programm in der Command Line gestartet.
|
||||
|
||||
Nutze ?, um dir die Befehle anzeigen zu lassen.
|
||||
|
||||
|
||||
|
||||
104
build.gradle
104
build.gradle
@@ -18,11 +18,6 @@ dependencies {
|
||||
implementation 'com.mysql:mysql-connector-j:9.5.0'
|
||||
}
|
||||
|
||||
jacoco {
|
||||
toolVersion = '0.8.13'
|
||||
reportsDirectory.set(layout.buildDirectory.dir('customJacocoReportDir'))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
@@ -36,6 +31,7 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
// Test configuration
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
@@ -43,19 +39,105 @@ test {
|
||||
exceptionFormat "full"
|
||||
showStandardStreams = true
|
||||
}
|
||||
|
||||
// Generate test reports in a specific location
|
||||
reports {
|
||||
html.outputLocation.set(layout.buildDirectory.dir("reports/tests"))
|
||||
junitXml.outputLocation.set(layout.buildDirectory.dir("reports/tests"))
|
||||
}
|
||||
|
||||
finalizedBy jacocoTestReport
|
||||
}
|
||||
|
||||
// Jacoco configuration
|
||||
jacoco {
|
||||
toolVersion = '0.8.13'
|
||||
reportsDirectory.set(layout.buildDirectory.dir('reports/jacoco'))
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
dependsOn test
|
||||
reports {
|
||||
xml.required = false
|
||||
xml.required = true
|
||||
csv.required = false
|
||||
html.outputLocation.set(layout.buildDirectory.dir('jacocoHtml'))
|
||||
html.required = true
|
||||
html.outputLocation.set(layout.buildDirectory.dir("reports/jacoco/html"))
|
||||
}
|
||||
}
|
||||
jacocoTestCoverageVerification {
|
||||
dependsOn test
|
||||
}
|
||||
|
||||
// Application configuration
|
||||
application {
|
||||
mainClass = "hhn.temp.project.Main"
|
||||
}
|
||||
}
|
||||
|
||||
// Custom task to print information after build
|
||||
task printInfo {
|
||||
dependsOn test, jacocoTestReport
|
||||
doLast {
|
||||
println("\n" + "="*50)
|
||||
println("BUILD AND TESTS COMPLETED SUCCESSFULLY!")
|
||||
println("="*50)
|
||||
println("\nTest Results Location:")
|
||||
println(" HTML: ${layout.buildDirectory.get()}/reports/tests/index.html")
|
||||
println(" XML: ${layout.buildDirectory.get()}/reports/tests/TEST-*.xml")
|
||||
|
||||
println("\nJacoco Coverage Reports:")
|
||||
println(" HTML: ${layout.buildDirectory.get()}/reports/jacoco/html/index.html")
|
||||
println(" XML: ${layout.buildDirectory.get()}/reports/jacoco/test/jacocoTestReport.xml")
|
||||
|
||||
println("\nTo run the application:")
|
||||
println(" gradle run --console=plain")
|
||||
println("\nTo run tests and generate coverage reports:")
|
||||
println(" gradle test jacocoTestReport")
|
||||
println("="*50)
|
||||
}
|
||||
}
|
||||
|
||||
// Custom task that combines clean, test, jacocoTestReport
|
||||
task cleanTestReport {
|
||||
dependsOn clean, test, jacocoTestReport
|
||||
description = 'Clean build and run tests with coverage reports'
|
||||
group = 'verification'
|
||||
}
|
||||
|
||||
// Configure the standard run task
|
||||
run {
|
||||
dependsOn test, jacocoTestReport
|
||||
standardInput = System.in
|
||||
|
||||
doFirst {
|
||||
println("\n" + "="*50)
|
||||
println("TESTS COMPLETED - STARTING APPLICATION...")
|
||||
println("="*50)
|
||||
}
|
||||
}
|
||||
|
||||
// Create an alias task
|
||||
task cleanRun {
|
||||
dependsOn clean, run
|
||||
description = 'Clean build, run tests with coverage, then run the application'
|
||||
group = 'application'
|
||||
}
|
||||
|
||||
// Alternative: Create a separate task that doesn't chain dependencies
|
||||
task startApp(type: JavaExec) {
|
||||
description = 'Start the application (without running tests first)'
|
||||
group = 'application'
|
||||
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
mainClass = application.mainClass
|
||||
standardInput = System.in
|
||||
standardOutput = System.out
|
||||
|
||||
// Configure to run in foreground
|
||||
systemProperties System.getProperties()
|
||||
|
||||
doFirst {
|
||||
println("\n" + "="*50)
|
||||
println("STARTING APPLICATION...")
|
||||
println("="*50)
|
||||
}
|
||||
}
|
||||
|
||||
// Make test and jacocoTestReport trigger the info print
|
||||
test.finalizedBy printInfo
|
||||
@@ -19,14 +19,14 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
private final static Path SELECT_TASK = Path.of("resources/sql/SelectTaskTable.sql");
|
||||
private final static Path UPDATE_TASK = Path.of("resources/sql/UpdateTaskTable.sql");
|
||||
private final static Path COUNT_ALL_TASK = Path.of("resources/sql/CountAllFieldsTask.sql");
|
||||
private final static Path SELECT_ALL_TASK = Path.of("resources/sql/SelectAllFieldsTask.sql");
|
||||
private final static Path SELECT_ALL_TASK = Path.of("resources/sql/SelectAllTask.sql");
|
||||
private final static Path SELECT_TASK_BY_ID = Path.of("resources/sql/SelectTaskById.sql");
|
||||
private final static Path INSERT_WORKER = Path.of("resources/sql/InsertWorkerTable.sql");
|
||||
private final static Path DELETE_WORKER = Path.of("resources/sql/DeleteWorkerTable.sql");
|
||||
private final static Path SELECT_WORKER = Path.of("resources/sql/SelectWorkerTable.sql");
|
||||
private final static Path UPDATE_WORKER = Path.of("resources/sql/UpdateWorkerTable.sql");
|
||||
private final static Path COUNT_ALL_WORKER = Path.of("resources/sql/CountAllFieldsWorker.sql");
|
||||
private final static Path SELECT_ALL_WORKER = Path.of("resources/sql/SelectAllFieldsWorker.sql");
|
||||
private final static Path SELECT_ALL_WORKER = Path.of("resources/sql/SelectAllWorker.sql");
|
||||
private final static Path SELECT_WORKER_BY_ID = Path.of("resources/sql/SelectWorkerById.sql");
|
||||
|
||||
public enum QueryMode {
|
||||
@@ -46,7 +46,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
SELECT_WORKER_BY_ID,
|
||||
}
|
||||
|
||||
public String loadFile(QueryMode queryMode) throws IOException {
|
||||
private String loadFile(QueryMode queryMode) throws IOException {
|
||||
switch (queryMode) {
|
||||
case INSERT_TASK -> {
|
||||
return Files.readString(INSERT_TASK);
|
||||
@@ -110,7 +110,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.INSERT_TASK);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement preparedStatement = connection.prepareStatement(query);) {
|
||||
@@ -136,7 +136,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.INSERT_WORKER);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement preparedStatement = connection.prepareStatement(query);) {
|
||||
@@ -159,7 +159,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.UPDATE_TASK);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement preparedStatement = connection.prepareStatement(query);) {
|
||||
@@ -177,7 +177,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.UPDATE_WORKER);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement preparedStatement = connection.prepareStatement(query);) {
|
||||
@@ -194,7 +194,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.DELETE_TASK);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement preparedStatement = connection.prepareStatement(query);) {
|
||||
@@ -209,7 +209,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.DELETE_WORKER);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement preparedStatement = connection.prepareStatement(query);) {
|
||||
@@ -224,7 +224,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.SELECT_ALL_TASK);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.SELECT_ALL_WORKER);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.SELECT_TASK_BY_ID);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.SELECT_WORKER_BY_ID);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.COUNT_ALL_TASK);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
try (Statement statement = connection.createStatement();
|
||||
@@ -370,7 +370,7 @@ public class SimpleDatabaseManager implements DatabaseManager {
|
||||
try {
|
||||
query = loadFile(QueryMode.COUNT_ALL_WORKER);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
try (Statement statement = connection.createStatement();
|
||||
|
||||
@@ -19,6 +19,7 @@ public class BadCasesTest {
|
||||
public void assertNewTasksAreNotNull() {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.addTask(workerId, null, null));
|
||||
manager.removeWorker(workerId);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert List isn't empty after adding a task")
|
||||
@@ -26,6 +27,8 @@ public class BadCasesTest {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||
assertFalse(manager.getTaskMap().isEmpty());
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert only existing tasks can be edited")
|
||||
@@ -33,6 +36,7 @@ public class BadCasesTest {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.editTask(workerId, 99969, "I", "am Illegal"));
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.editTask(22200, 99969, "I", "am Illegal"));
|
||||
manager.removeWorker(workerId);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert Add Task is programmed defensively")
|
||||
@@ -40,6 +44,7 @@ public class BadCasesTest {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.addTask( 20203,"I", "am Illegal"));
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.addTask( workerId,null, null));
|
||||
manager.removeWorker(workerId);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert that Remove Task is programmed defensively")
|
||||
@@ -67,5 +72,7 @@ public class BadCasesTest {
|
||||
} catch (Exception e) {
|
||||
fail("Should not crash just because a command is invalid");
|
||||
}
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,8 @@ import hhn.temp.project.provider.SimpleDatabaseManager;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class DatabaseBadCasesTest {
|
||||
|
||||
private DatabaseManager databaseManager;
|
||||
@@ -19,7 +15,7 @@ public class DatabaseBadCasesTest {
|
||||
public void setup() throws SQLException {
|
||||
databaseManager = new SimpleDatabaseManager();
|
||||
databaseManager.connect();
|
||||
databaseManager.clearDatabase();
|
||||
//databaseManager.clearDatabase();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -31,6 +27,9 @@ public class DatabaseBadCasesTest {
|
||||
databaseManager.saveTask(task);
|
||||
|
||||
databaseManager.saveTask(taskFaker);
|
||||
|
||||
databaseManager.deleteTask(task.getTaskId());
|
||||
databaseManager.deleteTask(taskFaker.getTaskId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -42,5 +41,8 @@ public class DatabaseBadCasesTest {
|
||||
databaseManager.saveWorker(worker);
|
||||
|
||||
databaseManager.saveWorker(workerFaker);
|
||||
|
||||
databaseManager.deleteWorker(worker.getId());
|
||||
databaseManager.deleteWorker(workerFaker.getId());
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,6 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -21,7 +19,7 @@ public class DatabaseGoodCasesTest {
|
||||
public void setup() throws SQLException {
|
||||
databaseManager = new SimpleDatabaseManager();
|
||||
databaseManager.connect();
|
||||
databaseManager.clearDatabase();
|
||||
//databaseManager.clearDatabase();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -39,7 +37,7 @@ public class DatabaseGoodCasesTest {
|
||||
assertEquals(task.getName(), reTask.getName());
|
||||
assertEquals(task.getWorkerId(), reTask.getWorkerId());
|
||||
|
||||
assertEquals(1, databaseManager.getTotalNumberOfTasks());
|
||||
databaseManager.deleteTask(task.getTaskId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,9 +53,11 @@ public class DatabaseGoodCasesTest {
|
||||
|
||||
assertEquals(worker.getId(), reWorker.getId());
|
||||
assertEquals(worker.getName(), reWorker.getName());
|
||||
|
||||
databaseManager.deleteWorker(worker.getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
/*@Test
|
||||
@DisplayName("Clearing the database (Task and Worker) test")
|
||||
public void clearDatabaseTest() throws SQLException, InterruptedException {
|
||||
Task task1 = new Task(10, 5, "Hello", "World");
|
||||
@@ -81,10 +81,5 @@ public class DatabaseGoodCasesTest {
|
||||
|
||||
assertEquals(0, databaseManager.getTotalNumberOfTasks());
|
||||
assertEquals(0, databaseManager.getTotalNumberOfWorkers());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRandom() throws IOException, URISyntaxException {
|
||||
System.out.println(databaseManager.loadFile(SimpleDatabaseManager.QueryMode.INSERT_TASK));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -23,6 +23,8 @@ public class GoodCasesTest {
|
||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||
assertNotNull(manager.getTask(taskId));
|
||||
assertEquals("Run", manager.getTask(taskId).getName());
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -32,6 +34,8 @@ public class GoodCasesTest {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||
assertEquals(sizeCount + 1, manager.getTaskMap().size());
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -42,6 +46,8 @@ public class GoodCasesTest {
|
||||
manager.editTask(workerId, taskId, "Walk", "Walk 3 Miles");
|
||||
assertEquals("Walk", manager.getTask(taskId).getName());
|
||||
assertEquals("Walk 3 Miles", manager.getTask(taskId).getDescription());
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -53,6 +59,7 @@ public class GoodCasesTest {
|
||||
assertEquals(sizeCount + 1, manager.getTaskMap().size());
|
||||
manager.removeTask(taskId);
|
||||
assertEquals(sizeCount, manager.getTaskMap().size());
|
||||
manager.removeWorker(workerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -62,6 +69,7 @@ public class GoodCasesTest {
|
||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||
manager.removeTask(taskId);
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.getTask(taskId));
|
||||
manager.removeWorker(workerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,6 +82,8 @@ public class GoodCasesTest {
|
||||
assertEquals(manager.getWorkerMap().get(workerId).getId(), workerId);
|
||||
assertEquals(manager.getTask(taskId).getTaskId(), taskId);
|
||||
assertEquals(manager.getTask(taskId).getWorkerId(), workerId);
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
|
||||
}
|
||||
|
||||
@@ -86,6 +96,8 @@ public class GoodCasesTest {
|
||||
assertSame(TaskState.FINISHED, manager.getTask(taskId).getTaskState());
|
||||
manager.unfinishTask(workerId, taskId);
|
||||
assertSame(TaskState.IN_PROGRESS, manager.getTask(taskId).getTaskState());
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -120,6 +132,7 @@ public class GoodCasesTest {
|
||||
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("remove"));
|
||||
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("back"));
|
||||
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("edit"));
|
||||
manager.removeWorker(workerId);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Check that editing is possible through UI")
|
||||
@@ -133,6 +146,8 @@ public class GoodCasesTest {
|
||||
assertEquals("Walk", manager.getTask(taskId).getName());
|
||||
assertEquals("Walk 3 Miles", manager.getTask(taskId).getDescription());
|
||||
manager.getUserCommands().handleInput("back");
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeTask(taskId);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert that removing Workers is possible through the UI")
|
||||
@@ -144,6 +159,8 @@ public class GoodCasesTest {
|
||||
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("remove"));
|
||||
manager.getUserCommands().handleInput(workerId2 + "");
|
||||
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("back"));
|
||||
manager.removeWorker(workerId);
|
||||
manager.removeWorker(workerId2);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert that removing a worker removes the worker from the worker list")
|
||||
|
||||
Reference in New Issue
Block a user