@Override
    public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) {
        final ModelId modelId = entityDescriptor.id();
        try {
            final Output output = outputService.load(modelId.id());
            return Optional.of(exportNativeEntity(output, entityDescriptorIds));
        } catch (NotFoundException e) {
            LOG.debug("Couldn't find output {}", entityDescriptor, e);
            return Optional.empty();
        }
    }
@Test
    public void exportEntity() {
        final ImmutableMap<String, Object> configuration = ImmutableMap.of(
                "some-setting", "foobar"
        );
        final OutputImpl output = OutputImpl.create(
                "01234567890",
                "Output Title",
                "org.graylog2.outputs.LoggingOutput",
                "admin",
                configuration,
                new Date(0L),
                null
        );
        final EntityDescriptor descriptor = EntityDescriptor.create(output.getId(), ModelTypes.OUTPUT_V1);
        final EntityDescriptorIds entityDescriptorIds = EntityDescriptorIds.of(descriptor);
        final Entity entity = facade.exportNativeEntity(output, entityDescriptorIds);

        assertThat(entity).isInstanceOf(EntityV1.class);
        assertThat(entity.id()).isEqualTo(ModelId.of(entityDescriptorIds.get(descriptor).orElse(null)));
        assertThat(entity.type()).isEqualTo(ModelTypes.OUTPUT_V1);

        final EntityV1 entityV1 = (EntityV1) entity;
        final OutputEntity outputEntity = objectMapper.convertValue(entityV1.data(), OutputEntity.class);
        assertThat(outputEntity.title()).isEqualTo(ValueReference.of("Output Title"));
        assertThat(outputEntity.type()).isEqualTo(ValueReference.of("org.graylog2.outputs.LoggingOutput"));
        assertThat(outputEntity.configuration()).containsEntry("some-setting", ValueReference.of("foobar"));
    }