### Question:
SmsNotificationResourceClientImpl extends AbstractResourceClient implements SmsNotificationResourceClient { @Nonnull @Override public ResultResponseModel<CreateSmsNotificationResponse> createSmsNotification(@Nonnull final CreateSmsNotificationRequest request) { return createSmsNotificationInternal(request, null); } SmsNotificationResourceClientImpl(final Client client, final String apiPath); @Nonnull @Override ResultResponseModel<CreateSmsNotificationResponse> createSmsNotification(@Nonnull final CreateSmsNotificationRequest request); @Nonnull @Override ResultResponseModel<CreateSmsNotificationResponse> createSmsNotification(@Nonnull final CreateSmsNotificationRequest request, final @Nonnull String authToken);  }### Answer:
@Test public void testCreateSmsNotificationWithInvalidArgument() { assertThatThrownBy(() -> smsNotificationResourceClient.createSmsNotification(null)); assertThatThrownBy(() -> smsNotificationResourceClient.createSmsNotification(new CreateSmsNotificationRequest(), apiPath)); }
@Test public void testCreateSmsNotificationWithAuthorization() { final CreateSmsNotificationRequest request = new CreateSmsNotificationRequest(); final String authToken = uuid(); final WebTarget webTarget = createMock(WebTarget.class); final Invocation.Builder requestBuilder = createMock(Invocation.Builder.class); final ResultResponseModel<CreateSmsNotificationResponse> resultResponseModel = new ResultResponseModel<>(new CreateSmsNotificationResponse(new SmsNotificationModel())); expect(client.target(apiPath)).andReturn(webTarget); expect(webTarget.path("notification/sms/create")).andReturn(webTarget); expect(webTarget.request(MediaType.APPLICATION_JSON_TYPE)).andReturn(requestBuilder); expect(requestBuilder.header("Authorization", "Bearer " + authToken)).andReturn(requestBuilder); expect(requestBuilder.post(eq(Entity.entity(request, MediaType.APPLICATION_JSON_TYPE)), isA(GenericType.class))).andReturn(resultResponseModel); replayAll(); assertThat(smsNotificationResourceClient.createSmsNotification(request, authToken)).isEqualTo(resultResponseModel); verifyAll(); }
@Test public void testCreateSmsNotification() { final CreateSmsNotificationRequest request = new CreateSmsNotificationRequest(); final WebTarget webTarget = createMock(WebTarget.class); final Invocation.Builder requestBuilder = createMock(Invocation.Builder.class); final ResultResponseModel<CreateSmsNotificationResponse> resultResponseModel = new ResultResponseModel<>(new CreateSmsNotificationResponse(new SmsNotificationModel())); expect(client.target(apiPath)).andReturn(webTarget); expect(webTarget.path("notification/sms/create")).andReturn(webTarget); expect(webTarget.request(MediaType.APPLICATION_JSON_TYPE)).andReturn(requestBuilder); expect(requestBuilder.post(eq(Entity.entity(request, MediaType.APPLICATION_JSON_TYPE)), isA(GenericType.class))).andReturn(resultResponseModel); replayAll(); assertThat(smsNotificationResourceClient.createSmsNotification(request)).isEqualTo(resultResponseModel); verifyAll(); }