@Override
    public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) {
        final ModelId modelId = entityDescriptor.id();
        final Collector collector = collectorService.find(modelId.id());
        if (isNull(collector)) {
            LOG.debug("Couldn't find collector {}", entityDescriptor);
            return Optional.empty();
        }

        return Optional.of(exportNativeEntity(collector, entityDescriptorIds));
    }
@Test
    @MongoDBFixtures("SidecarCollectorFacadeTest.json")
    public void exportEntity() {
        final EntityDescriptor descriptor = EntityDescriptor.create("5b4c920b4b900a0024af0001", ModelTypes.SIDECAR_COLLECTOR_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.SIDECAR_COLLECTOR_V1);

        final EntityV1 entityV1 = (EntityV1) entity;
        final SidecarCollectorEntity collectorEntity = objectMapper.convertValue(entityV1.data(), SidecarCollectorEntity.class);

        assertThat(collectorEntity.name()).isEqualTo(ValueReference.of("filebeat"));
        assertThat(collectorEntity.serviceType()).isEqualTo(ValueReference.of("exec"));
        assertThat(collectorEntity.nodeOperatingSystem()).isEqualTo(ValueReference.of("linux"));
        assertThat(collectorEntity.executablePath()).isEqualTo(ValueReference.of("/usr/lib/graylog-sidecar/filebeat"));
        assertThat(collectorEntity.executeParameters()).isEqualTo(ValueReference.of("-c %s"));
        assertThat(collectorEntity.validationParameters()).isEqualTo(ValueReference.of("test config -c %s"));
        assertThat(collectorEntity.defaultTemplate()).isEqualTo(ValueReference.of(""));
    }