@Override
    public NativeEntity<CacheDto> createNativeEntity(Entity entity,
                                                     Map<String, ValueReference> parameters,
                                                     Map<EntityDescriptor, Object> nativeEntities,
                                                     String username) {
        if (entity instanceof EntityV1) {
            return decode((EntityV1) entity, parameters);
        } else {
            throw new IllegalArgumentException("Unsupported entity version: " + entity.getClass());
        }
    }
@Test
    public void createNativeEntity() {
        final Entity entity = EntityV1.builder()
                .id(ModelId.of("1"))
                .type(ModelTypes.LOOKUP_CACHE_V1)
                .data(objectMapper.convertValue(LookupCacheEntity.create(
                        ValueReference.of(DefaultEntityScope.NAME),
                        ValueReference.of("no-op-cache"),
                        ValueReference.of("No-op cache"),
                        ValueReference.of("No-op cache"),
                        ReferenceMapUtils.toReferenceMap(ImmutableMap.of("type", "none"))
                ), JsonNode.class))
                .build();
        assertThat(cacheService.findAll()).isEmpty();

        final NativeEntity<CacheDto> nativeEntity = facade.createNativeEntity(entity, Collections.emptyMap(), Collections.emptyMap(), "username");
        final NativeEntityDescriptor descriptor = nativeEntity.descriptor();
        final CacheDto cacheDto = nativeEntity.entity();

        assertThat(nativeEntity.descriptor().id()).isNotNull();
        assertThat(descriptor.type()).isEqualTo(ModelTypes.LOOKUP_CACHE_V1);
        assertThat(cacheDto.name()).isEqualTo("no-op-cache");
        assertThat(cacheDto.title()).isEqualTo("No-op cache");
        assertThat(cacheDto.description()).isEqualTo("No-op cache");
        assertThat(cacheDto.config().type()).isEqualTo("none");

        assertThat(cacheService.findAll()).hasSize(1);
    }