SequenceIdUtil { public String createSequenceId(final String handlerKey, final SequenceDescriptor sequenceDescriptor) { StringBuilder sb = new StringBuilder(); String descriptorKey = sequenceDescriptorKeyUtil.createDescriptorKey(sequenceDescriptor.getGroupName(), sequenceDescriptor.getName()); sb.append(descriptorKey).append(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()).append(handlerKey); return sb.toString(); }  String getDescriptorKey(final String sequenceId); String getHandlerKey(final String sequenceId); String createSequenceId(final String handlerKey, final SequenceDescriptor sequenceDescriptor);  }
@Test public void testCreateSequenceId() { String handlerKey = "Key"; given(sequenceDescriptor.getGroupName()).willReturn("groupname"); given(sequenceDescriptor.getName()).willReturn("name"); given(sequenceDescriptorKeyUtil.createDescriptorKey("groupname", "name")).willReturn("groupname_name"); Whitebox.setInternalState(underTest, "sequenceDescriptorKeyUtil", sequenceDescriptorKeyUtil); String result = underTest.createSequenceId(handlerKey, sequenceDescriptor); Assert.assertEquals(result, "groupname_name|Key"); }