@Test public void shouldReturnObservableObjectMessageForObservableObjectValue() { Object sampleObservableObject = "sample object"; when(objectRegistry.getIdOrFail(sampleObservableObject)).thenReturn(SAMPLE_ID); Value message = cut.map(sampleObservableObject, true); assertThat(message.getObservableObjectId()).isEqualTo(SAMPLE_ID); assertThat(message.getSimpleObjectValue()).isNull(); }
public Object map(final Value message) throws ObjectToIdMappingException { final UUID valueId = message.getObservableObjectId(); if (valueId != null) { return objectRegistry.getByIdOrFail(valueId); } else { return message.getSimpleObjectValue(); } }
ValueMapper { public Object map(final Value message) throws ObjectToIdMappingException { final UUID valueId = message.getObservableObjectId(); if (valueId != null) { return objectRegistry.getByIdOrFail(valueId); } else { return message.getSimpleObjectValue(); } } }
ValueMapper { public Object map(final Value message) throws ObjectToIdMappingException { final UUID valueId = message.getObservableObjectId(); if (valueId != null) { return objectRegistry.getByIdOrFail(valueId); } else { return message.getSimpleObjectValue(); } } ValueMapper(final WeakObjectRegistry objectRegistry); }
ValueMapper { public Object map(final Value message) throws ObjectToIdMappingException { final UUID valueId = message.getObservableObjectId(); if (valueId != null) { return objectRegistry.getByIdOrFail(valueId); } else { return message.getSimpleObjectValue(); } } ValueMapper(final WeakObjectRegistry objectRegistry); Object map(final Value message); Value map(final Object value, final boolean isObservable); }
ValueMapper { public Object map(final Value message) throws ObjectToIdMappingException { final UUID valueId = message.getObservableObjectId(); if (valueId != null) { return objectRegistry.getByIdOrFail(valueId); } else { return message.getSimpleObjectValue(); } } ValueMapper(final WeakObjectRegistry objectRegistry); Object map(final Value message); Value map(final Object value, final boolean isObservable);  }