Search in sources :

Example 1 with PartitionKeyGroupCreateRequest

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);
}
Also used : PartitionKeyGroup(org.finra.herd.model.api.xml.PartitionKeyGroup) PartitionKeyGroupCreateRequest(org.finra.herd.model.api.xml.PartitionKeyGroupCreateRequest) PartitionKeyGroupKey(org.finra.herd.model.api.xml.PartitionKeyGroupKey) Test(org.junit.Test)

Example 2 with PartitionKeyGroupCreateRequest

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;
}
Also used : PartitionKeyGroupCreateRequest(org.finra.herd.model.api.xml.PartitionKeyGroupCreateRequest)

Aggregations

PartitionKeyGroupCreateRequest (org.finra.herd.model.api.xml.PartitionKeyGroupCreateRequest)2 PartitionKeyGroup (org.finra.herd.model.api.xml.PartitionKeyGroup)1 PartitionKeyGroupKey (org.finra.herd.model.api.xml.PartitionKeyGroupKey)1 Test (org.junit.Test)1