@Test public void testGreetingException() { String userId = UUID.randomUUID().toString(); when(accountClient.getAccount(AuthConstant.AUTHORIZATION_BOT_SERVICE, userId)) .thenThrow(new RuntimeException("get account failure exception")); BaseResponse baseResponse = botClient.sendSmsGreeting(GreetingRequest.builder().userId(userId).build()); log.info(baseResponse.toString()); assertThat(baseResponse.isSuccess()).isFalse(); assertThat(baseResponse.getCode()).isEqualTo(ResultCode.FAILURE); }
@PostMapping(value = "/sms_greeting") BaseResponse sendSmsGreeting(@RequestBody @Validated GreetingRequest request) { greetingService.greeting(request.getUserId()); return BaseResponse.builder().message("greeting sent").build(); }
GreetingController { @PostMapping(value = "/sms_greeting") BaseResponse sendSmsGreeting(@RequestBody @Validated GreetingRequest request) { greetingService.greeting(request.getUserId()); return BaseResponse.builder().message("greeting sent").build(); } }
GreetingController { @PostMapping(value = "/sms_greeting") BaseResponse sendSmsGreeting(@RequestBody @Validated GreetingRequest request) { greetingService.greeting(request.getUserId()); return BaseResponse.builder().message("greeting sent").build(); }  }
GreetingController { @PostMapping(value = "/sms_greeting") BaseResponse sendSmsGreeting(@RequestBody @Validated GreetingRequest request) { greetingService.greeting(request.getUserId()); return BaseResponse.builder().message("greeting sent").build(); }   }
GreetingController { @PostMapping(value = "/sms_greeting") BaseResponse sendSmsGreeting(@RequestBody @Validated GreetingRequest request) { greetingService.greeting(request.getUserId()); return BaseResponse.builder().message("greeting sent").build(); }    }