### Question:
OMBucketCreateRequest extends OMClientRequest { @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { CreateBucketRequest createBucketRequest = getOmRequest().getCreateBucketRequest(); BucketInfo bucketInfo = createBucketRequest.getBucketInfo(); OmUtils.validateBucketName(bucketInfo.getBucketName()); KeyProviderCryptoExtension kmsProvider = ozoneManager.getKmsProvider(); CreateBucketRequest.Builder newCreateBucketRequest = createBucketRequest.toBuilder(); BucketInfo.Builder newBucketInfo = bucketInfo.toBuilder(); long initialTime = Time.now(); newBucketInfo.setCreationTime(initialTime) .setModificationTime(initialTime); if (bucketInfo.hasBeinfo()) { newBucketInfo.setBeinfo(getBeinfo(kmsProvider, bucketInfo)); } boolean hasSourceVolume = bucketInfo.hasSourceVolume(); boolean hasSourceBucket = bucketInfo.hasSourceBucket(); if (hasSourceBucket != hasSourceVolume) { throw new OMException("Both source volume and source bucket are " + "required for bucket links", OMException.ResultCodes.INVALID_REQUEST); } if (hasSourceBucket && bucketInfo.hasBeinfo()) { throw new OMException("Encryption cannot be set for bucket links", OMException.ResultCodes.INVALID_REQUEST); } newCreateBucketRequest.setBucketInfo(newBucketInfo.build()); return getOmRequest().toBuilder().setUserInfo(getUserInfo()) .setCreateBucketRequest(newCreateBucketRequest.build()).build(); } OMBucketCreateRequest(OMRequest omRequest); @Override OMRequest preExecute(OzoneManager ozoneManager); @Override OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
      long transactionLogIndex,
      OzoneManagerDoubleBufferHelper ozoneManagerDoubleBufferHelper); boolean checkQuotaBytesValid(OMMetadataManager metadataManager,
      OmVolumeArgs omVolumeArgs, OmBucketInfo omBucketInfo, String volumeKey);  }### Answer:
@Test public void testPreExecute() throws Exception { String volumeName = UUID.randomUUID().toString(); String bucketName = UUID.randomUUID().toString(); doPreExecute(volumeName, bucketName); LambdaTestUtils.intercept(OMException.class, "Invalid bucket name: b1", () -> doPreExecute("volume1", "b1")); }