Skip to content

Commit

Permalink
テストクラスのcatch内におけるfail()メソッドの削除
Browse files Browse the repository at this point in the history
  • Loading branch information
rnakagawa16 committed Nov 6, 2023
1 parent 3e12b33 commit daa5561
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class AssetApplicationServiceTest {
verify(this.store, times(1)).getResource(asset);
} catch (AssetNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class BasketApplicationServiceTest {
verify(this.repository, times(1)).update(basket);
} catch (BasketNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand Down Expand Up @@ -79,7 +78,6 @@ public class BasketApplicationServiceTest {
assertThat(argBasket.getItems().size()).isEqualTo(0);
} catch (BasketNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand Down Expand Up @@ -123,7 +121,6 @@ public class BasketApplicationServiceTest {
verify(this.repository, times(1)).remove(basket);;
} catch (BasketNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand Down Expand Up @@ -165,7 +162,6 @@ public class BasketApplicationServiceTest {
verify(this.repository, times(1)).update(basket);
} catch (BasketNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand All @@ -191,7 +187,6 @@ public class BasketApplicationServiceTest {
assertThat(argBasket.getItems().size()).isEqualTo(0);
} catch (BasketNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand Down Expand Up @@ -220,7 +215,6 @@ public class BasketApplicationServiceTest {
assertThat(argBasket.getItems().get(0).getQuantity()).isEqualTo(newQuantity);
} catch (BasketNotFoundException e) {
e.printStackTrace();
fail(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class OrderApplicationServiceTest {
try {
service.createOrder(basketId, shipToAddress);
} catch (Exception e) {
fail("例外は発生しないはず", e);
e.printStackTrace();
}

// Assert
Expand Down Expand Up @@ -107,7 +107,7 @@ public class OrderApplicationServiceTest {
try {
actual = service.getOrder(orderId, buyerId);
} catch (Exception e) {
fail("例外は発生しないはず", e);
e.printStackTrace();
}

// Assert
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -37,7 +36,6 @@ void testGet_01() {
.andExpect(content().contentType(MediaType.IMAGE_PNG_VALUE));
} catch (Exception e) {
e.printStackTrace();
fail();
}
}

Expand All @@ -52,7 +50,6 @@ void testGet_02() {
.andExpect(status().isNotFound());
} catch (Exception e) {
e.printStackTrace();
fail();
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -32,7 +31,6 @@ void testGet_serverCheck() {
.andExpect(content().json("{'status':'UP'}"));
} catch (Exception e) {
e.printStackTrace();
fail();
}
}

Expand All @@ -45,7 +43,6 @@ void testGet_databaseCheck() {
.andExpect(content().json("{'status':'UP'}"));
} catch (Exception e) {
e.printStackTrace();
fail();
}
}
}

0 comments on commit daa5561

Please sign in to comment.