Skip to content

Commit 6185a38

Browse files
authored
fix: updates build config and adjusts tests (#460)
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 4a2cb00 commit 6185a38

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

lesson_13/maps_java/maps_app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232

3333
application {
3434
// Define the main class for the application.
35-
mainClass.set("com.codedifferently.lesson12.Lesson12")
35+
mainClass.set("com.codedifferently.lesson13.Lesson13")
3636
}
3737

3838
tasks.named<Test>("test") {

lesson_14/exceptions/exceptions_app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232

3333
application {
3434
// Define the main class for the application.
35-
mainClass.set("com.codedifferently.lesson12.Lesson12")
35+
mainClass.set("com.codedifferently.lesson14.Lesson14")
3636
}
3737

3838
tasks.named<Test>("test") {

lesson_14/exceptions/exceptions_app/src/test/java/com/codedifferently/lesson14/ecommerce/EcommerceSystemTest.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ void testPlaceOrder_productDoesNotExist() throws Exception {
4040
assertThatThrownBy(() -> ecommerceSystem.placeOrder("1", 1))
4141
.isInstanceOf(ProductNotFoundException.class)
4242
.hasMessage("Product with ID 1 not found");
43+
44+
// Act
45+
assertThatThrownBy(() -> ecommerceSystem.placeOrder("34", 1))
46+
.isInstanceOf(ProductNotFoundException.class)
47+
.hasMessage("Product with ID 34 not found");
4348
}
4449

4550
@Test
@@ -58,18 +63,23 @@ void testCheckOrderStatus_orderDoesNotExist() {
5863
assertThatThrownBy(() -> ecommerceSystem.checkOrderStatus("1"))
5964
.isInstanceOf(OrderNotFoundException.class)
6065
.hasMessage("Order with ID 1 not found");
66+
67+
// Act
68+
assertThatThrownBy(() -> ecommerceSystem.checkOrderStatus("33"))
69+
.isInstanceOf(OrderNotFoundException.class)
70+
.hasMessage("Order with ID 33 not found");
6171
}
6272

6373
@Test
6474
void testCheckOrderStatus_orderCancelled() throws Exception {
6575
// Arrange
66-
ecommerceSystem.addProduct("1", "Laptop");
67-
String orderId = ecommerceSystem.placeOrder("1", 1);
76+
ecommerceSystem.addProduct("58", "Laptop");
77+
String orderId = ecommerceSystem.placeOrder("58", 1);
6878
ecommerceSystem.cancelOrder(orderId);
6979

7080
// Act
71-
assertThatThrownBy(() -> ecommerceSystem.checkOrderStatus("1"))
81+
assertThatThrownBy(() -> ecommerceSystem.checkOrderStatus("58"))
7282
.isInstanceOf(OrderNotFoundException.class)
73-
.hasMessage("Order with ID 1 not found");
83+
.hasMessage("Order with ID 58 not found");
7484
}
7585
}

0 commit comments

Comments
 (0)