@Override
    public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) {
        final ModelId modelId = entityDescriptor.id();

        try {
            final Input input = inputService.find(modelId.id());
            final InputWithExtractors inputWithExtractors = InputWithExtractors.create(input, inputService.getExtractors(input));
            return Optional.of(exportNativeEntity(inputWithExtractors, entityDescriptorIds));
        } catch (NotFoundException e) {
            return Optional.empty();
        }
    }
@Test
    @MongoDBFixtures("InputFacadeTest.json")
    public void exportEntity() {
        final ModelId id = ModelId.of("5acc84f84b900a4ff290d9a7");
        final EntityDescriptor descriptor = EntityDescriptor.create(id, ModelTypes.INPUT_V1);
        final EntityDescriptorIds entityDescriptorIds = EntityDescriptorIds.of(descriptor);
        final Entity entity = facade.exportEntity(descriptor, entityDescriptorIds).orElseThrow(AssertionError::new);

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

        final EntityV1 entityV1 = (EntityV1) entity;
        final InputEntity inputEntity = objectMapper.convertValue(entityV1.data(), InputEntity.class);
        assertThat(inputEntity.title()).isEqualTo(ValueReference.of("Local Raw UDP"));
        assertThat(inputEntity.type()).isEqualTo(ValueReference.of("org.graylog2.inputs.raw.udp.RawUDPInput"));
        assertThat(inputEntity.global()).isEqualTo(ValueReference.of(false));
        assertThat(inputEntity.configuration())
                .containsEntry("bind_address", ValueReference.of("127.0.0.1"))
                .containsEntry("port", ValueReference.of(5555));
    }