use of org.finra.herd.model.api.xml.PartitionKeyGroupCreateRequest in project herd by FINRAOS.
the class PartitionKeyGroupRestControllerTest method testCreatePartitionKeyGroup.
@Test
public void testCreatePartitionKeyGroup() {
// Create a partition key group.
PartitionKeyGroup partitionKeyGroup = new PartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP));
PartitionKeyGroupCreateRequest request = partitionKeyGroupServiceTestHelper.createPartitionKeyGroupCreateRequest(PARTITION_KEY_GROUP);
when(partitionKeyGroupService.createPartitionKeyGroup(request)).thenReturn(partitionKeyGroup);
PartitionKeyGroup resultPartitionKeyGroup = partitionKeyGroupRestController.createPartitionKeyGroup(request);
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP, resultPartitionKeyGroup);
// Verify the external calls.
verify(partitionKeyGroupService).createPartitionKeyGroup(request);
verifyNoMoreInteractions(partitionKeyGroupService);
// Validate the returned object.
assertEquals(partitionKeyGroup, resultPartitionKeyGroup);
}
use of org.finra.herd.model.api.xml.PartitionKeyGroupCreateRequest in project herd by FINRAOS.
the class PartitionKeyGroupServiceTestHelper method createPartitionKeyGroupCreateRequest.
/**
* Creates a partition key group create request.
*
* @param partitionKeyGroupName the partition key group name
*
* @return the created partition key group create request
*/
public PartitionKeyGroupCreateRequest createPartitionKeyGroupCreateRequest(String partitionKeyGroupName) {
PartitionKeyGroupCreateRequest partitionKeyGroupCreateRequest = new PartitionKeyGroupCreateRequest();
partitionKeyGroupCreateRequest.setPartitionKeyGroupKey(createPartitionKeyGroupKey(partitionKeyGroupName));
return partitionKeyGroupCreateRequest;
}
Aggregations