@Override
    public NativeEntity<InputWithExtractors> createNativeEntity(Entity entity,
                                                                Map<String, ValueReference> parameters,
                                                                Map<EntityDescriptor, Object> nativeEntities,
                                                                String username) {
        if (entity instanceof EntityV1) {
            return decode((EntityV1) entity, parameters, username);
        } else {
            throw new IllegalArgumentException("Unsupported entity version: " + entity.getClass());
        }
    }
@Test
    @Ignore("Doesn't work without massive amount of mocks")
    public void createNativeEntity() {
        final Map<String, Object> configuration = new HashMap<>();
        configuration.put("override_source", null);
        configuration.put("recv_buffer_size", 262144);
        configuration.put("bind_address", "127.0.0.1");
        configuration.put("port", 5555);
        configuration.put("number_worker_threads", 8);
        final Entity entity = EntityV1.builder()
                .id(ModelId.of("5acc84f84b900a4ff290d9a7"))
                .type(ModelTypes.INPUT_V1)
                .data(objectMapper.convertValue(InputEntity.create(
                        ValueReference.of("Local Raw UDP"),
                        ReferenceMapUtils.toReferenceMap(configuration),
                        Collections.emptyMap(),
                        ValueReference.of("org.graylog2.inputs.raw.udp.RawUDPInput"),
                        ValueReference.of(false),
                        Collections.emptyList()), JsonNode.class))
                .build();

        final NativeEntity<InputWithExtractors> nativeEntity = facade.createNativeEntity(entity, Collections.emptyMap(), Collections.emptyMap(), "username");

        final InputWithExtractors inputWithExtractors = nativeEntity.entity();
        final Input savedInput = inputWithExtractors.input();
        final String savedId = savedInput.getId();
        assertThat(nativeEntity.descriptor()).isEqualTo(EntityDescriptor.create(savedId, ModelTypes.INPUT_V1));
        assertThat(savedInput.getTitle()).isEqualTo("Local Raw UDP");
        assertThat(savedInput.getType()).isEqualTo("org.graylog2.inputs.raw.udp.RawUDPInput");
        assertThat(savedInput.isGlobal()).isFalse();
        assertThat(savedInput.getContentPack()).isNull();
    }