From daa556195a85475001cdd3ec2a698b3d0f277120 Mon Sep 17 00:00:00 2001 From: RyoNakagawa Date: Mon, 6 Nov 2023 09:56:13 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AEcatch=E5=86=85=E3=81=AB=E3=81=8A=E3=81=91?= =?UTF-8?q?=E3=82=8Bfail()=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=81=AE?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applicationcore/assets/AssetApplicationServiceTest.java | 1 - .../baskets/BasketApplicationServiceTest.java | 6 ------ .../applicationcore/order/OrderApplicationServiceTest.java | 4 ++-- .../com/dressca/web/controller/AssetsControllerTest.java | 3 --- .../java/com/dressca/web/controller/HealthCheckTest.java | 3 --- 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/assets/AssetApplicationServiceTest.java b/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/assets/AssetApplicationServiceTest.java index dfbd57185..f03e43bf6 100644 --- a/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/assets/AssetApplicationServiceTest.java +++ b/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/assets/AssetApplicationServiceTest.java @@ -50,7 +50,6 @@ public class AssetApplicationServiceTest { verify(this.store, times(1)).getResource(asset); } catch (AssetNotFoundException e) { e.printStackTrace(); - fail(e); } } diff --git a/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/baskets/BasketApplicationServiceTest.java b/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/baskets/BasketApplicationServiceTest.java index b05362ab7..58639d0f0 100644 --- a/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/baskets/BasketApplicationServiceTest.java +++ b/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/baskets/BasketApplicationServiceTest.java @@ -51,7 +51,6 @@ public class BasketApplicationServiceTest { verify(this.repository, times(1)).update(basket); } catch (BasketNotFoundException e) { e.printStackTrace(); - fail(e); } } @@ -79,7 +78,6 @@ public class BasketApplicationServiceTest { assertThat(argBasket.getItems().size()).isEqualTo(0); } catch (BasketNotFoundException e) { e.printStackTrace(); - fail(e); } } @@ -123,7 +121,6 @@ public class BasketApplicationServiceTest { verify(this.repository, times(1)).remove(basket);; } catch (BasketNotFoundException e) { e.printStackTrace(); - fail(e); } } @@ -165,7 +162,6 @@ public class BasketApplicationServiceTest { verify(this.repository, times(1)).update(basket); } catch (BasketNotFoundException e) { e.printStackTrace(); - fail(e); } } @@ -191,7 +187,6 @@ public class BasketApplicationServiceTest { assertThat(argBasket.getItems().size()).isEqualTo(0); } catch (BasketNotFoundException e) { e.printStackTrace(); - fail(e); } } @@ -220,7 +215,6 @@ public class BasketApplicationServiceTest { assertThat(argBasket.getItems().get(0).getQuantity()).isEqualTo(newQuantity); } catch (BasketNotFoundException e) { e.printStackTrace(); - fail(e); } } diff --git a/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/order/OrderApplicationServiceTest.java b/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/order/OrderApplicationServiceTest.java index dfdf12001..4b5ec6197 100644 --- a/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/order/OrderApplicationServiceTest.java +++ b/samples/web-csr/dressca-backend/application-core/src/test/java/com/dressca/applicationcore/order/OrderApplicationServiceTest.java @@ -55,7 +55,7 @@ public class OrderApplicationServiceTest { try { service.createOrder(basketId, shipToAddress); } catch (Exception e) { - fail("例外は発生しないはず", e); + e.printStackTrace(); } // Assert @@ -107,7 +107,7 @@ public class OrderApplicationServiceTest { try { actual = service.getOrder(orderId, buyerId); } catch (Exception e) { - fail("例外は発生しないはず", e); + e.printStackTrace(); } // Assert diff --git a/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/AssetsControllerTest.java b/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/AssetsControllerTest.java index 290db12cc..9528ddf9c 100644 --- a/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/AssetsControllerTest.java +++ b/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/AssetsControllerTest.java @@ -1,6 +1,5 @@ package com.dressca.web.controller; -import static org.junit.jupiter.api.Assertions.fail; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -37,7 +36,6 @@ void testGet_01() { .andExpect(content().contentType(MediaType.IMAGE_PNG_VALUE)); } catch (Exception e) { e.printStackTrace(); - fail(); } } @@ -52,7 +50,6 @@ void testGet_02() { .andExpect(status().isNotFound()); } catch (Exception e) { e.printStackTrace(); - fail(); } } } diff --git a/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/HealthCheckTest.java b/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/HealthCheckTest.java index 8fc3b4a6a..d40da7a91 100644 --- a/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/HealthCheckTest.java +++ b/samples/web-csr/dressca-backend/web/src/test/java/com/dressca/web/controller/HealthCheckTest.java @@ -1,6 +1,5 @@ package com.dressca.web.controller; -import static org.junit.jupiter.api.Assertions.fail; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -32,7 +31,6 @@ void testGet_serverCheck() { .andExpect(content().json("{'status':'UP'}")); } catch (Exception e) { e.printStackTrace(); - fail(); } } @@ -45,7 +43,6 @@ void testGet_databaseCheck() { .andExpect(content().json("{'status':'UP'}")); } catch (Exception e) { e.printStackTrace(); - fail(); } } }