ExpectedPartitionValueRestController extends HerdBaseController { @RequestMapping( value = EXPECTED_PARTITION_VALUES_URI_PREFIX + "/partitionKeyGroups/{partitionKeyGroupName}/expectedPartitionValues/{expectedPartitionValue}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EXPECTED_PARTITION_VALUES_GET) public ExpectedPartitionValueInformation getExpectedPartitionValue(@PathVariable("partitionKeyGroupName") String partitionKeyGroupName, @PathVariable("expectedPartitionValue") String expectedPartitionValue, @RequestParam(value = "offset", required = false) Integer offset) { ExpectedPartitionValueKey expectedPartitionValueKey = new ExpectedPartitionValueKey(); expectedPartitionValueKey.setPartitionKeyGroupName(partitionKeyGroupName); expectedPartitionValueKey.setExpectedPartitionValue(expectedPartitionValue); return expectedPartitionValueService.getExpectedPartitionValue(expectedPartitionValueKey, offset); }  @RequestMapping(value = EXPECTED_PARTITION_VALUES_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EXPECTED_PARTITION_VALUES_POST) ExpectedPartitionValuesInformation createExpectedPartitionValues(@RequestBody ExpectedPartitionValuesCreateRequest request); @RequestMapping( value = EXPECTED_PARTITION_VALUES_URI_PREFIX + "/partitionKeyGroups/{partitionKeyGroupName}/expectedPartitionValues/{expectedPartitionValue}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EXPECTED_PARTITION_VALUES_GET) ExpectedPartitionValueInformation getExpectedPartitionValue(@PathVariable("partitionKeyGroupName") String partitionKeyGroupName,
        @PathVariable("expectedPartitionValue") String expectedPartitionValue, @RequestParam(value = "offset", required = false) Integer offset); @RequestMapping(value = EXPECTED_PARTITION_VALUES_URI_PREFIX + "/partitionKeyGroups/{partitionKeyGroupName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EXPECTED_PARTITION_VALUES_GET) ExpectedPartitionValuesInformation getExpectedPartitionValues(@PathVariable("partitionKeyGroupName") String partitionKeyGroupName,
        @RequestParam(value = "startExpectedPartitionValue", required = false) String startExpectedPartitionValue,
        @RequestParam(value = "endExpectedPartitionValue", required = false) String endExpectedPartitionValue); @RequestMapping(value = EXPECTED_PARTITION_VALUES_URI_PREFIX, method = RequestMethod.DELETE, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EXPECTED_PARTITION_VALUES_DELETE) ExpectedPartitionValuesInformation deleteExpectedPartitionValues(@RequestBody ExpectedPartitionValuesDeleteRequest request); static final String EXPECTED_PARTITION_VALUES_URI_PREFIX; }
@Test public void testGetExpectedPartitionValue() { int offset = 1; String partitionOffset = expectedPartitionValueDaoTestHelper.getTestSortedExpectedPartitionValues().get(offset); ExpectedPartitionValueKey expectedPartitionValueKey = new ExpectedPartitionValueKey(PARTITION_KEY_GROUP, partitionOffset); ExpectedPartitionValueInformation expectedPartitionValuesInformation = new ExpectedPartitionValueInformation(expectedPartitionValueKey); when(expectedPartitionValueService.getExpectedPartitionValue(expectedPartitionValueKey, offset)).thenReturn(expectedPartitionValuesInformation); ExpectedPartitionValueInformation resultPartitionValueInformation = expectedPartitionValueRestController.getExpectedPartitionValue(PARTITION_KEY_GROUP, partitionOffset, offset); verify(expectedPartitionValueService).getExpectedPartitionValue(expectedPartitionValueKey, offset); verifyNoMoreInteractions(expectedPartitionValueService); assertEquals(expectedPartitionValuesInformation, resultPartitionValueInformation); }