use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testDeletePartitionKeyGroup.
@Test
public void testDeletePartitionKeyGroup() {
// Create and persist a partition key group entity.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP);
// Validate that this partition key group exists.
partitionKeyGroupService.getPartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP));
// Delete this partition key group.
PartitionKeyGroup deletedPartitionKeyGroup = partitionKeyGroupService.deletePartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP));
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP, deletedPartitionKeyGroup);
// Ensure that this partition key group is no longer there.
assertNull(partitionKeyGroupDao.getPartitionKeyGroupByKey(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP)));
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testDeletePartitionKeyGroupTrimParameters.
@Test
public void testDeletePartitionKeyGroupTrimParameters() {
// Create and persist a partition key group entity.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP);
// Validate that this partition key group exists.
partitionKeyGroupService.getPartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP));
// Delete this partition key group by passing partition key group name with leading and trailing whitespace characters.
PartitionKeyGroup deletedPartitionKeyGroup = partitionKeyGroupService.deletePartitionKeyGroup(new PartitionKeyGroupKey(addWhitespace(PARTITION_KEY_GROUP)));
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP, deletedPartitionKeyGroup);
// Ensure that this partition key group is no longer there.
assertNull(partitionKeyGroupDao.getPartitionKeyGroupByKey(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP)));
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testGetPartitionKeyGroupTrimParameters.
@Test
public void testGetPartitionKeyGroupTrimParameters() {
// Create and persist a partition key group entity.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP);
// Retrieve the partition key group by passing partition key group name with leading and trailing whitespace characters.
PartitionKeyGroup resultPartitionKeyGroup = partitionKeyGroupService.getPartitionKeyGroup(new PartitionKeyGroupKey(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 testDeletePartitionKeyGroupUpperCaseParameters.
@Test
public void testDeletePartitionKeyGroupUpperCaseParameters() {
// Create and persist a partition key group entity with a lowercase name.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP.toLowerCase());
// Delete this partition key group by passing partition key group name in upper case.
PartitionKeyGroup deletedPartitionKeyGroup = partitionKeyGroupService.deletePartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP.toUpperCase()));
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP.toLowerCase(), deletedPartitionKeyGroup);
// Ensure that this partition key group is no longer there.
assertNull(partitionKeyGroupDao.getPartitionKeyGroupByKey(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP.toLowerCase())));
}
use of org.finra.herd.model.api.xml.PartitionKeyGroup in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testGetPartitionKeyGroupUpperCaseParameters.
@Test
public void testGetPartitionKeyGroupUpperCaseParameters() {
// Create and persist a partition key group entity with a lowercase name.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP.toLowerCase());
// Retrieve the partition key group by passing partition key group name in upper case.
PartitionKeyGroup resultPartitionKeyGroup = partitionKeyGroupService.getPartitionKeyGroup(new PartitionKeyGroupKey(PARTITION_KEY_GROUP.toUpperCase()));
// Validate the returned object.
partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(PARTITION_KEY_GROUP.toLowerCase(), resultPartitionKeyGroup);
}
Aggregations