use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testCreatePartitionKeyGroupTrimParameters.
@Test
public void testCreatePartitionKeyGroupTrimParameters() {
// Create a partition key group by passing partition key group name with leading and trailing whitespace characters.
PartitionKeyGroup resultPartitionKeyGroup = partitionKeyGroupServiceTestHelper.createPartitionKeyGroup(addWhitespace(PARTITION_KEY_GROUP));
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP, resultPartitionKeyGroup);
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testGetPartitionKeyGroupLowerCaseParameters.
@Test
public void testGetPartitionKeyGroupLowerCaseParameters() {
// Create and persist a partition key group with an uppercase name.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP.toUpperCase());
// Retrieve the partition key group by passing partition key group name in lower case.
PartitionKeyGroup resultPartitionKeyGroup = partitionKeyGroupService.getPartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP.toLowerCase()));
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP.toUpperCase(), resultPartitionKeyGroup);
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupRestControllerTest method testGetPartitionKeyGroup.
@Test
public void testGetPartitionKeyGroup() {
PartitionKeyGroup partitionKeyGroup = new PartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP));
PartitionKeyGroupKey partitionKeyGroupKey = new PartitionKeyGroupKey(PARTITION_KEY_GROUP);
when(partitionKeyGroupService.getPartitionKeyGroup(partitionKeyGroupKey)).thenReturn(partitionKeyGroup);
// Retrieve the partition key group.
PartitionKeyGroup resultPartitionKeyGroup = partitionKeyGroupRestController.getPartitionKeyGroup(PARTITION_KEY_GROUP);
// Verify the external calls.
verify(partitionKeyGroupService).getPartitionKeyGroup(partitionKeyGroupKey);
verifyNoMoreInteractions(partitionKeyGroupService);
// Validate the returned object.
assertEquals(partitionKeyGroup, resultPartitionKeyGroup);
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupRestControllerTest method testDeletePartitionKeyGroup.
@Test
public void testDeletePartitionKeyGroup() {
PartitionKeyGroup partitionKeyGroup = new PartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP));
PartitionKeyGroupKey partitionKeyGroupKey = new PartitionKeyGroupKey(PARTITION_KEY_GROUP);
when(partitionKeyGroupService.deletePartitionKeyGroup(partitionKeyGroupKey)).thenReturn(partitionKeyGroup);
// Delete this partition key group.
PartitionKeyGroup deletedPartitionKeyGroup = partitionKeyGroupRestController.deletePartitionKeyGroup(PARTITION_KEY_GROUP);
// Verify the external calls.
verify(partitionKeyGroupService).deletePartitionKeyGroup(partitionKeyGroupKey);
verifyNoMoreInteractions(partitionKeyGroupService);
// Validate the returned object.
assertEquals(partitionKeyGroup, deletedPartitionKeyGroup);
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceImpl method createPartitionKeyGroupFromEntity.
/**
* Creates the partition key group from the persisted entity.
*
* @param partitionKeyGroupEntity the partition key group entity
*
* @return the partition key group
*/
private PartitionKeyGroup createPartitionKeyGroupFromEntity(PartitionKeyGroupEntity partitionKeyGroupEntity) {
// Create the partition key group.
PartitionKeyGroup partitionKeyGroup = new PartitionKeyGroup();
PartitionKeyGroupKey partitionKeyGroupKey = new PartitionKeyGroupKey();
partitionKeyGroup.setPartitionKeyGroupKey(partitionKeyGroupKey);
partitionKeyGroupKey.setPartitionKeyGroupName(partitionKeyGroupEntity.getPartitionKeyGroupName());
return partitionKeyGroup;
}
Aggregations