From 6ff9f0305593c5310a2ee06b041d0b19c79c3d61 Mon Sep 17 00:00:00 2001 From: Sara Prifti <72574638+sarapr97@users.noreply.github.com> Date: Thu, 26 May 2022 20:01:15 +0200 Subject: [PATCH] Edited case where customerId==null --- src/main/java/de/rwth/swc/sqa/Application.java | 8 ++++++++ src/test/java/de/rwth/swc/sqa/CustomerTest.java | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/rwth/swc/sqa/Application.java b/src/main/java/de/rwth/swc/sqa/Application.java index a3bd13e..368ce1e 100644 --- a/src/main/java/de/rwth/swc/sqa/Application.java +++ b/src/main/java/de/rwth/swc/sqa/Application.java @@ -17,6 +17,7 @@ public class Application { public static void main(String[] args) {SpringApplication.run(Application.class, args);} + /* @Bean CommandLineRunner run(DataService dataService) { return args -> { @@ -31,6 +32,13 @@ public class Application { discountCards.add(discountCard); dataService.saveDiscountCardToCustomer(customer.getId(), discountCards); + + }; } + + */ + + + } diff --git a/src/test/java/de/rwth/swc/sqa/CustomerTest.java b/src/test/java/de/rwth/swc/sqa/CustomerTest.java index 7769b3a..049768f 100644 --- a/src/test/java/de/rwth/swc/sqa/CustomerTest.java +++ b/src/test/java/de/rwth/swc/sqa/CustomerTest.java @@ -59,7 +59,7 @@ public class CustomerTest { @Test @Order(2) public void addDiscountCardToCustomerTest() { - Long customerId =0L; + Long customerId =null; String path = "/customers/"+customerId+"/discountcards"; Map<String, Object> parms = new HashMap<String, Object>(); //404 @@ -135,7 +135,6 @@ public class CustomerTest { RestAssured.given().when().get(path).then().statusCode(200); - } } -- GitLab