use of org.finra.herd.model.api.xml.PartitionKeyGroupKeys in project herd by FINRAOS.
the class PartitionKeyGroupServiceImpl method getPartitionKeyGroups.
/**
* Gets a list of keys for all existing partition key groups.
*
* @return the partition key group keys
*/
@Override
public PartitionKeyGroupKeys getPartitionKeyGroups() {
// Create and populate a list of partition key group keys.
PartitionKeyGroupKeys partitionKeyGroupKeys = new PartitionKeyGroupKeys();
partitionKeyGroupKeys.getPartitionKeyGroupKeys().addAll(partitionKeyGroupDao.getPartitionKeyGroups());
return partitionKeyGroupKeys;
}
use of org.finra.herd.model.api.xml.PartitionKeyGroupKeys in project herd by FINRAOS.
the class PartitionKeyGroupServiceTest method testGetPartitionKeyGroups.
@Test
public void testGetPartitionKeyGroups() {
// Create and persist two partition key group entities.
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP);
partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP_2);
// Get the list of partition key groups.
PartitionKeyGroupKeys partitionKeyGroupKeys = partitionKeyGroupService.getPartitionKeyGroups();
// Validate the returned object.
assertTrue(partitionKeyGroupKeys.getPartitionKeyGroupKeys().size() >= 2);
assertTrue(partitionKeyGroupKeys.getPartitionKeyGroupKeys().contains(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP)));
assertTrue(partitionKeyGroupKeys.getPartitionKeyGroupKeys().contains(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP_2)));
}
use of org.finra.herd.model.api.xml.PartitionKeyGroupKeys in project herd by FINRAOS.
the class PartitionKeyGroupRestControllerTest method testGetPartitionKeyGroups.
@Test
public void testGetPartitionKeyGroups() {
PartitionKeyGroupKeys partitionKeyGroupKeys = new PartitionKeyGroupKeys(Arrays.asList(new PartitionKeyGroupKey(PARTITION_KEY_GROUP), new PartitionKeyGroupKey(PARTITION_KEY_GROUP_2)));
when(partitionKeyGroupService.getPartitionKeyGroups()).thenReturn(partitionKeyGroupKeys);
// Get the list of partition key groups.
PartitionKeyGroupKeys resultPartitionKeyGroupKeys = partitionKeyGroupRestController.getPartitionKeyGroups();
// Validate the returned object.
assertTrue(resultPartitionKeyGroupKeys.getPartitionKeyGroupKeys().size() >= 2);
assertTrue(resultPartitionKeyGroupKeys.getPartitionKeyGroupKeys().contains(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP)));
assertTrue(resultPartitionKeyGroupKeys.getPartitionKeyGroupKeys().contains(partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(PARTITION_KEY_GROUP_2)));
// Verify the external calls.
verify(partitionKeyGroupService).getPartitionKeyGroups();
verifyNoMoreInteractions(partitionKeyGroupService);
// Validate the returned object.
assertEquals(partitionKeyGroupKeys, resultPartitionKeyGroupKeys);
}
Aggregations