Search in sources :

Example 1 with PartitionKeyGroupKeys

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

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

Example 3 with PartitionKeyGroupKeys

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

Aggregations

PartitionKeyGroupKeys (org.finra.herd.model.api.xml.PartitionKeyGroupKeys)3 Test (org.junit.Test)2 PartitionKeyGroupKey (org.finra.herd.model.api.xml.PartitionKeyGroupKey)1