@Test
public void testGetS3KeyPrefix()
{

    // Create a business object data key.
    BusinessObjectDataKey businessObjectDataKey =
        new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES,
            DATA_VERSION);
    // Create a delimited list of sub-partition values.
    String delimitedSubPartitionValues = String.join("|", SUBPARTITION_VALUES);
    // Create an S3 key prefix information.
    S3KeyPrefixInformation s3KeyPrefixInformation = new S3KeyPrefixInformation();
    // Mock a servlet request.
    ServletRequest servletRequest = mock(ServletRequest.class);
    when(servletRequest.getParameterMap()).thenReturn(new HashMap<>());
    // Mock the external calls.
    when(herdStringHelper.splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues)).thenReturn(SUBPARTITION_VALUES);
    when(storageUnitService.getS3KeyPrefix(businessObjectDataKey, PARTITION_KEY, STORAGE_NAME, CREATE_NEW_VERSION)).thenReturn(s3KeyPrefixInformation);
    // Call the method under test.
    S3KeyPrefixInformation result = businessObjectDataRestController
        .getS3KeyPrefix(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_KEY, PARTITION_VALUE,
            delimitedSubPartitionValues, DATA_VERSION, STORAGE_NAME, CREATE_NEW_VERSION, servletRequest);
    // Verify the external calls.
    verify(herdStringHelper).splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues);
    verify(storageUnitService).getS3KeyPrefix(businessObjectDataKey, PARTITION_KEY, STORAGE_NAME, CREATE_NEW_VERSION);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(s3KeyPrefixInformation, result);
}