 1 @WebMvcTest(controllers = SendMoneyController.class)
 2 class SendMoneyControllertest {
 3
 4   @Autowired
 5   private MockMve mockMvc;
 6
 7   @MockBean
 8   private SendMoneyUseCase sendMoneyUseCase;
 9
10   private static final String ENDPOINT
11     = "/accounts/sendMoney/{sourceAccountId}/{targetAccountId}/{amount}";
12
13   @Test
14   void testSendMoney() throws Exception {
15
16     mockMvc.perform(
17         post(ENDPOINT, 41L, 42L, 500)
18           .header("Content-Type", "application/json"))
19           .andExpect(status().isOk());
20
21     then(sendMoneyUseCase).should()
22         .sendMoney(eq(new SendMoneyCommand(
23             new AccountId(41L),
24             new AccountId(42L),
25             Money.of(500L))));
26   }
27 }
