コード例 #1
0
  @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);
  }
コード例 #2
0
  @Test
  public void testDeletePartitionKeyGroupLowerCaseParameters() {
    // Create and persist a partition key group entity with an uppercase name.
    partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(PARTITION_KEY_GROUP.toUpperCase());

    // Validate that this partition key group exists.
    partitionKeyGroupService.getPartitionKeyGroup(
        new PartitionKeyGroupKey(PARTITION_KEY_GROUP.toUpperCase()));

    // Retrieve the partition key group by passing partition key group name in lower case.
    PartitionKeyGroup deletedPartitionKeyGroup =
        partitionKeyGroupService.deletePartitionKeyGroup(
            new PartitionKeyGroupKey(PARTITION_KEY_GROUP.toLowerCase()));

    // Validate the returned object.
    partitionKeyGroupServiceTestHelper.validatePartitionKeyGroup(
        PARTITION_KEY_GROUP.toUpperCase(), deletedPartitionKeyGroup);

    // Ensure that this partition key group is no longer there.
    assertNull(
        partitionKeyGroupDao.getPartitionKeyGroupByKey(
            partitionKeyGroupServiceTestHelper.createPartitionKeyGroupKey(
                PARTITION_KEY_GROUP.toUpperCase())));
  }