@Test
public void createRequest_shouldSetKmsKeyName() throws IOException {

  String kmsKeyName = "testKmsKey";
  GoogleCloudStorageWriteChannel writeChannel =
      new GoogleCloudStorageWriteChannel(
          new Storage(HTTP_TRANSPORT, JSON_FACTORY, r -> {}),
          new ClientRequestHelper<>(),
          newDirectExecutorService(),
          AsyncWriteChannelOptions.DEFAULT,
          new StorageResourceId(BUCKET_NAME, OBJECT_NAME),
          CreateObjectOptions.DEFAULT_NO_OVERWRITE.toBuilder().setKmsKeyName(kmsKeyName).build(),
          ObjectWriteConditions.NONE);
  Storage.Objects.Insert request =
      writeChannel.createRequest(
          new InputStreamContent("plain/text", new ByteArrayInputStream(new byte[0])));
  assertThat(request.getKmsKeyName()).isEqualTo(kmsKeyName);
}