SetAddressFromObjectNameReceiverCreator extends BasicIntermediateReceiverObjectCreator { @Override public Collection<Object> enumIdentifiers(IObject config, IObject context) throws InvalidReceiverPipelineException, ReceiverObjectCreatorException { try { Object name = config.getValue(objectNameFieldName); return Collections.singletonList(name); } catch (ReadValueException | InvalidArgumentException e) { throw new ReceiverObjectCreatorException(e); } } SetAddressFromObjectNameReceiverCreator(IReceiverObjectCreator underlyingObjectCreator, IObject filterConfig, IObject objectConfig); @Override void create(IReceiverObjectListener listener, IObject config, IObject context); @Override Collection<Object> enumIdentifiers(IObject config, IObject context); @Override void acceptItem(Object itemId, Object item);  }
@Test public void Should_enumerateTheName() throws Exception { IReceiverObjectCreator creator = new SetAddressFromObjectNameReceiverCreator(underlyingCreatorMock, filterConfigMock, configMock); assertEquals(Collections.singletonList("the_object_name"), creator.enumIdentifiers(configMock, contextMock)); }