fix(core): CrudEvent should not be done on the repository side for KV

This commit is contained in:
brian.mulier
2025-10-30 11:39:30 +01:00
committed by brian-mulier-p
parent 1c097209ac
commit 07e90de835
5 changed files with 12 additions and 31 deletions

View File

@@ -63,7 +63,7 @@ public class MetadataMigrationCommandTest {
assertThat(out.toString()).contains("✅ Metadata migration complete.");
// Still it's not in the metadata repository because no flow exist to find that secret
// Still it's not in the metadata repository because no flow exist to find that kv
assertThat(kvMetadataRepository.findByName(tenantId, namespace, key).isPresent()).isFalse();
assertThat(kvMetadataRepository.findByName(tenantId, anotherNamespace, anotherKey).isPresent()).isFalse();
@@ -79,9 +79,9 @@ public class MetadataMigrationCommandTest {
PicocliRunner.call(App.class, ctx, kvMetadataMigrationCommand);
assertThat(out.toString()).contains("✅ Metadata migration complete.");
Optional<PersistedKvMetadata> foundSecret = kvMetadataRepository.findByName(tenantId, namespace, key);
assertThat(foundSecret.isPresent()).isTrue();
assertThat(foundSecret.get().getDescription()).isEqualTo(description);
Optional<PersistedKvMetadata> foundKv = kvMetadataRepository.findByName(tenantId, namespace, key);
assertThat(foundKv.isPresent()).isTrue();
assertThat(foundKv.get().getDescription()).isEqualTo(description);
assertThat(kvMetadataRepository.findByName(tenantId, anotherNamespace, anotherKey).isPresent()).isFalse();
KVStore kvStore = new InternalKVStore(tenantId, namespace, storage, kvMetadataRepository);