Search in sources :

Example 1 with SpillLocationVerifier

use of com.amazonaws.athena.connector.lambda.domain.spill.SpillLocationVerifier in project aws-athena-query-federation by awslabs.

the class CompositeHandlerTest method doGetSplits.

@Test
public void doGetSplits() throws Exception {
    GetSplitsRequest req = mock(GetSplitsRequest.class);
    when(req.getRequestType()).thenReturn(MetadataRequestType.GET_SPLITS);
    SpillLocationVerifier mockVerifier = mock(SpillLocationVerifier.class);
    doNothing().when(mockVerifier).checkBucketAuthZ(any(String.class));
    Whitebox.setInternalState(mockMetadataHandler, "verifier", mockVerifier);
    compositeHandler.handleRequest(allocator, req, new ByteArrayOutputStream(), objectMapper);
    verify(mockMetadataHandler, times(1)).doGetSplits(any(BlockAllocatorImpl.class), any(GetSplitsRequest.class));
}
Also used : GetSplitsRequest(com.amazonaws.athena.connector.lambda.metadata.GetSplitsRequest) BlockAllocatorImpl(com.amazonaws.athena.connector.lambda.data.BlockAllocatorImpl) SpillLocationVerifier(com.amazonaws.athena.connector.lambda.domain.spill.SpillLocationVerifier) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

BlockAllocatorImpl (com.amazonaws.athena.connector.lambda.data.BlockAllocatorImpl)1 SpillLocationVerifier (com.amazonaws.athena.connector.lambda.domain.spill.SpillLocationVerifier)1 GetSplitsRequest (com.amazonaws.athena.connector.lambda.metadata.GetSplitsRequest)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Test (org.junit.Test)1