Search in sources :

Example 6 with PartitionKeyGroup

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

Example 7 with PartitionKeyGroup

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

Example 8 with PartitionKeyGroup

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

Example 9 with PartitionKeyGroup

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

Example 10 with PartitionKeyGroup

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

Aggregations

PartitionKeyGroup (org.finra.herd.model.api.xml.PartitionKeyGroup)15 Test (org.junit.Test)14 PartitionKeyGroupKey (org.finra.herd.model.api.xml.PartitionKeyGroupKey)13 PartitionKeyGroupCreateRequest (org.finra.herd.model.api.xml.PartitionKeyGroupCreateRequest)1 PartitionKeyGroupEntity (org.finra.herd.model.jpa.PartitionKeyGroupEntity)1