diff --git a/commander/pom.xml b/commander/pom.xml
index 5de5e562a..dde95c225 100644
--- a/commander/pom.xml
+++ b/commander/pom.xml
@@ -39,70 +39,33 @@
The application consists of abstract classes {@link Database} and {@link Service} + * which are extended by all the databases and services. Each service has a corresponding + * database to be updated and receives requests from an external user through the + * {@link Commander} class. There are 5 microservices: + *
Retries are managed using the {@link Retry} class, ensuring idempotence by performing + * checks before making requests to services and updating the {@link Order} class fields + * upon request success or definitive failure. + * + *
This class tests the following scenarios: + *
Each scenario is encapsulated in a corresponding method that sets up the service + * conditions and tests the order placement process. + * + *
The main method executes all success and failure cases to verify the application's + * behavior under different conditions. + * + *
Usage: + *
+ * {@code
+ * public static void main(String[] args) {
+ * AppAllCases app = new AppAllCases();
+ * app.testAllScenarios();
+ * }
+ * }
+ *
+ */
+
+public class AppAllCases {
+ private static final RetryParams retryParams = RetryParams.DEFAULT;
+ private static final TimeLimits timeLimits = TimeLimits.DEFAULT;
+
+ // Employee Database Fail Case
+ void employeeDatabaseUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var qdb = new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Employee Database Success Case
+ void employeeDbSuccessCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Messaging Database Fail Cases
+ void messagingDatabaseUnavailableCasePaymentSuccess() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ void messagingDatabaseUnavailableCasePaymentError() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+
+ void messagingDatabaseUnavailableCasePaymentFailure() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Messaging Database Success Case
+ void messagingSuccessCase() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Payment Database Fail Cases
+ void paymentNotPossibleCase() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new PaymentDetailsErrorException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase(new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ void paymentDatabaseUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Payment Database Success Case
+ void paymentSuccessCase() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase(new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Queue Database Fail Cases
+ void queuePaymentTaskDatabaseUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ void queueMessageTaskDatabaseUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ void queueEmployeeDbTaskDatabaseUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var qdb =
+ new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Queue Database Success Cases
+ void queueSuccessCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Shipping Database Fail Cases
+ void itemUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ void shippingDatabaseUnavailableCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException(), new DatabaseUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ void shippingItemNotPossibleCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase());
+ var eh = new EmployeeHandle(new EmployeeDatabase());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ // Shipping Database Success Cases
+ void shippingSuccessCase() {
+ var ps = new PaymentService(new PaymentDatabase());
+ var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
+ var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
+ var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
+ new DatabaseUnavailableException());
+ var qdb = new QueueDatabase();
+ var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
+ var user = new User("Jim", "ABCD");
+ var order = new Order(user, "book", 10f);
+ c.placeOrder(order);
+ }
+
+ /**
+ * Program entry point.
+ * @param args command line arguments
+ */
+ public static void main(String[] args) {
+ AppAllCases app = new AppAllCases();
+
+ // Employee Database cases
+ app.employeeDatabaseUnavailableCase();
+ app.employeeDbSuccessCase();
+
+ // Messaging Database cases
+ app.messagingDatabaseUnavailableCasePaymentSuccess();
+ app.messagingDatabaseUnavailableCasePaymentError();
+ app.messagingDatabaseUnavailableCasePaymentFailure();
+ app.messagingSuccessCase();
+
+ //Payment Database cases
+ app.paymentNotPossibleCase();
+ app.paymentDatabaseUnavailableCase();
+ app.paymentSuccessCase();
+
+ // Queue Database cases
+ app.queuePaymentTaskDatabaseUnavailableCase();
+ app.queueMessageTaskDatabaseUnavailableCase();
+ app.queueEmployeeDbTaskDatabaseUnavailableCase();
+ app.queueSuccessCase();
+
+ // Shipping Database cases
+ app.itemUnavailableCase();
+ app.shippingDatabaseUnavailableCase();
+ app.shippingItemNotPossibleCase();
+ app.shippingSuccessCase();
+ }
+}
\ No newline at end of file
diff --git a/commander/src/main/java/com/iluwatar/commander/AppEmployeeDbFailCases.java b/commander/src/main/java/com/iluwatar/commander/AppEmployeeDbFailCases.java
deleted file mode 100644
index a4b9d4ab6..000000000
--- a/commander/src/main/java/com/iluwatar/commander/AppEmployeeDbFailCases.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
- *
- * The MIT License
- * Copyright © 2014-2022 Ilkka Seppälä
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package com.iluwatar.commander;
-
-import com.iluwatar.commander.employeehandle.EmployeeDatabase;
-import com.iluwatar.commander.employeehandle.EmployeeHandle;
-import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
-import com.iluwatar.commander.exceptions.ItemUnavailableException;
-import com.iluwatar.commander.messagingservice.MessagingDatabase;
-import com.iluwatar.commander.messagingservice.MessagingService;
-import com.iluwatar.commander.paymentservice.PaymentDatabase;
-import com.iluwatar.commander.paymentservice.PaymentService;
-import com.iluwatar.commander.queue.QueueDatabase;
-import com.iluwatar.commander.shippingservice.ShippingDatabase;
-import com.iluwatar.commander.shippingservice.ShippingService;
-
-/**
- * AppEmployeeDbFailCases class looks at possible cases when Employee handle service is
- * available/unavailable.
- */
-public class AppEmployeeDbFailCases {
- private static final RetryParams retryParams = RetryParams.DEFAULT;
-
- private static final TimeLimits timeLimits = TimeLimits.DEFAULT;
-
- void employeeDatabaseUnavailableCase() {
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var qdb =
- new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void employeeDbSuccessCase() {
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- /**
- * Program entry point.
- *
- * @param args command line args
- */
-
- public static void main(String[] args) {
- var aefc = new AppEmployeeDbFailCases();
- aefc.employeeDbSuccessCase();
- }
-}
\ No newline at end of file
diff --git a/commander/src/main/java/com/iluwatar/commander/AppMessagingFailCases.java b/commander/src/main/java/com/iluwatar/commander/AppMessagingFailCases.java
deleted file mode 100644
index f7c58e0ae..000000000
--- a/commander/src/main/java/com/iluwatar/commander/AppMessagingFailCases.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
- *
- * The MIT License
- * Copyright © 2014-2022 Ilkka Seppälä
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package com.iluwatar.commander;
-
-import com.iluwatar.commander.employeehandle.EmployeeDatabase;
-import com.iluwatar.commander.employeehandle.EmployeeHandle;
-import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
-import com.iluwatar.commander.messagingservice.MessagingDatabase;
-import com.iluwatar.commander.messagingservice.MessagingService;
-import com.iluwatar.commander.paymentservice.PaymentDatabase;
-import com.iluwatar.commander.paymentservice.PaymentService;
-import com.iluwatar.commander.queue.QueueDatabase;
-import com.iluwatar.commander.shippingservice.ShippingDatabase;
-import com.iluwatar.commander.shippingservice.ShippingService;
-
-/**
- * AppMessagingFailCases class looks at possible cases when Messaging service is
- * available/unavailable.
- */
-
-public class AppMessagingFailCases {
- private static final RetryParams retryParams = RetryParams.DEFAULT;
-
- private static final TimeLimits timeLimits = TimeLimits.DEFAULT;
-
-
- void messagingDatabaseUnavailableCasePaymentSuccess() {
- //rest is successful
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void messagingDatabaseUnavailableCasePaymentError() {
- //rest is successful
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void messagingDatabaseUnavailableCasePaymentFailure() {
- //rest is successful
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb =
- new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void messagingSuccessCase() {
- //done here
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- /**
- * Program entry point.
- *
- * @param args command line args
- */
-
- public static void main(String[] args) {
- var amfc = new AppMessagingFailCases();
- amfc.messagingSuccessCase();
- }
-}
\ No newline at end of file
diff --git a/commander/src/main/java/com/iluwatar/commander/AppPaymentFailCases.java b/commander/src/main/java/com/iluwatar/commander/AppPaymentFailCases.java
deleted file mode 100644
index 02c7db04b..000000000
--- a/commander/src/main/java/com/iluwatar/commander/AppPaymentFailCases.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
- *
- * The MIT License
- * Copyright © 2014-2022 Ilkka Seppälä
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package com.iluwatar.commander;
-
-import com.iluwatar.commander.employeehandle.EmployeeDatabase;
-import com.iluwatar.commander.employeehandle.EmployeeHandle;
-import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
-import com.iluwatar.commander.exceptions.PaymentDetailsErrorException;
-import com.iluwatar.commander.messagingservice.MessagingDatabase;
-import com.iluwatar.commander.messagingservice.MessagingService;
-import com.iluwatar.commander.paymentservice.PaymentDatabase;
-import com.iluwatar.commander.paymentservice.PaymentService;
-import com.iluwatar.commander.queue.QueueDatabase;
-import com.iluwatar.commander.shippingservice.ShippingDatabase;
-import com.iluwatar.commander.shippingservice.ShippingService;
-
-/**
- * AppPaymentFailCases class looks at possible cases when Payment service is available/unavailable.
- */
-
-public class AppPaymentFailCases {
- private static final RetryParams retryParams = RetryParams.DEFAULT;
-
- private static final TimeLimits timeLimits = TimeLimits.DEFAULT;
-
- void paymentNotPossibleCase() {
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new PaymentDetailsErrorException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase(new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void paymentDatabaseUnavailableCase() {
- //rest is successful
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void paymentSuccessCase() {
- //goes to message after 2 retries maybe - rest is successful for now
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms =
- new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase(new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- /**
- * Program entry point.
- *
- * @param args command line args
- */
-
- public static void main(String[] args) {
- var apfc = new AppPaymentFailCases();
- apfc.paymentSuccessCase();
- }
-}
\ No newline at end of file
diff --git a/commander/src/main/java/com/iluwatar/commander/AppQueueFailCases.java b/commander/src/main/java/com/iluwatar/commander/AppQueueFailCases.java
deleted file mode 100644
index 5c5050272..000000000
--- a/commander/src/main/java/com/iluwatar/commander/AppQueueFailCases.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
- *
- * The MIT License
- * Copyright © 2014-2022 Ilkka Seppälä
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package com.iluwatar.commander;
-
-import com.iluwatar.commander.employeehandle.EmployeeDatabase;
-import com.iluwatar.commander.employeehandle.EmployeeHandle;
-import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
-import com.iluwatar.commander.exceptions.ItemUnavailableException;
-import com.iluwatar.commander.messagingservice.MessagingDatabase;
-import com.iluwatar.commander.messagingservice.MessagingService;
-import com.iluwatar.commander.paymentservice.PaymentDatabase;
-import com.iluwatar.commander.paymentservice.PaymentService;
-import com.iluwatar.commander.queue.QueueDatabase;
-import com.iluwatar.commander.shippingservice.ShippingDatabase;
-import com.iluwatar.commander.shippingservice.ShippingService;
-
-/**
- * AppQueueFailCases class looks at possible cases when Queue Database is available/unavailable.
- */
-
-public class AppQueueFailCases {
- private static final RetryParams retryParams = RetryParams.DEFAULT;
-
- private static final TimeLimits timeLimits = TimeLimits.DEFAULT;
-
-
- void queuePaymentTaskDatabaseUnavailableCase() {
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb =
- new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void queueMessageTaskDatabaseUnavailableCase() {
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb =
- new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void queueEmployeeDbTaskDatabaseUnavailableCase() {
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var qdb =
- new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void queueSuccessCase() {
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase());
- var ms =
- new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb =
- new QueueDatabase(new DatabaseUnavailableException(), new DatabaseUnavailableException());
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- /**
- * Program entry point.
- *
- * @param args command line args
- */
-
- public static void main(String[] args) {
- var aqfc = new AppQueueFailCases();
- aqfc.queueSuccessCase();
- }
-}
diff --git a/commander/src/main/java/com/iluwatar/commander/AppShippingFailCases.java b/commander/src/main/java/com/iluwatar/commander/AppShippingFailCases.java
deleted file mode 100644
index e15b1a911..000000000
--- a/commander/src/main/java/com/iluwatar/commander/AppShippingFailCases.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
- *
- * The MIT License
- * Copyright © 2014-2022 Ilkka Seppälä
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package com.iluwatar.commander;
-
-import com.iluwatar.commander.employeehandle.EmployeeDatabase;
-import com.iluwatar.commander.employeehandle.EmployeeHandle;
-import com.iluwatar.commander.exceptions.DatabaseUnavailableException;
-import com.iluwatar.commander.exceptions.ItemUnavailableException;
-import com.iluwatar.commander.exceptions.ShippingNotPossibleException;
-import com.iluwatar.commander.messagingservice.MessagingDatabase;
-import com.iluwatar.commander.messagingservice.MessagingService;
-import com.iluwatar.commander.paymentservice.PaymentDatabase;
-import com.iluwatar.commander.paymentservice.PaymentService;
-import com.iluwatar.commander.queue.QueueDatabase;
-import com.iluwatar.commander.shippingservice.ShippingDatabase;
-import com.iluwatar.commander.shippingservice.ShippingService;
-
-/**
- * AppShippingFailCases class looks at possible cases when Shipping service is
- * available/unavailable.
- */
-
-public class AppShippingFailCases {
-
- private static final RetryParams retryParams = RetryParams.DEFAULT;
- private static final TimeLimits timeLimits = TimeLimits.DEFAULT;
-
- void itemUnavailableCase() {
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase(), new ItemUnavailableException());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void shippingNotPossibleCase() {
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase(), new ShippingNotPossibleException());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void shippingDatabaseUnavailableCase() {
- //rest is successful
- var ps = new PaymentService(new PaymentDatabase());
- var ss = new ShippingService(new ShippingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ms = new MessagingService(new MessagingDatabase());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- void shippingSuccessCase() {
- //goes to payment after 2 retries maybe - rest is successful for now
- var ps = new PaymentService(new PaymentDatabase(), new DatabaseUnavailableException());
- var ss = new ShippingService(new ShippingDatabase(), new DatabaseUnavailableException(),
- new DatabaseUnavailableException());
- var ms = new MessagingService(new MessagingDatabase(), new DatabaseUnavailableException());
- var eh = new EmployeeHandle(new EmployeeDatabase());
- var qdb = new QueueDatabase();
- var c = new Commander(eh, ps, ss, ms, qdb, retryParams, timeLimits);
- var user = new User("Jim", "ABCD");
- var order = new Order(user, "book", 10f);
- c.placeOrder(order);
- }
-
- /**
- * Program entry point.
- *
- * @param args command line args
- */
-
- public static void main(String[] args) {
- var asfc = new AppShippingFailCases();
- asfc.shippingSuccessCase();
- }
-}
diff --git a/commander/src/main/java/com/iluwatar/commander/Commander.java b/commander/src/main/java/com/iluwatar/commander/Commander.java
index 42f1cabc4..24648bce3 100644
--- a/commander/src/main/java/com/iluwatar/commander/Commander.java
+++ b/commander/src/main/java/com/iluwatar/commander/Commander.java
@@ -67,10 +67,9 @@ import org.slf4j.LoggerFactory;
* {@link ShippingService}, {@link PaymentService}, {@link MessagingService}, {@link EmployeeHandle}
* and a {@link QueueDatabase}. We use retries to execute any instruction using {@link Retry} class,
* and idempotence is ensured by going through some checks before making requests to services and
- * making change in {@link Order} class fields if request succeeds or definitively fails. There are
- * 5 classes - {@link AppShippingFailCases}, {@link AppPaymentFailCases}, {@link
- * AppMessagingFailCases}, {@link AppQueueFailCases} and {@link AppEmployeeDbFailCases}, which look
- * at the different scenarios that may be encountered during the placing of an order.
+ * making change in {@link Order} class fields if request succeeds or definitively fails. There is
+ * a single class {@link AppAllCases} that looks at the different scenarios that may be encountered
+ * during the placing of an order, including both success and failure cases for each service.
*/
public class Commander {
diff --git a/commander/src/test/java/com/iluwatar/commander/CommanderTest.java b/commander/src/test/java/com/iluwatar/commander/CommanderTest.java
index f6c2351fe..87d065a30 100644
--- a/commander/src/test/java/com/iluwatar/commander/CommanderTest.java
+++ b/commander/src/test/java/com/iluwatar/commander/CommanderTest.java
@@ -52,6 +52,8 @@ class CommanderTest {
private static final List