XN137 commented on code in PR #2230:
URL: https://github.com/apache/polaris/pull/2230#discussion_r2247439127
##########
runtime/service/src/test/java/org/apache/polaris/service/quarkus/admin/ManagementServiceTest.java:
##########
@@ -302,34 +300,19 @@ public void
testCatalogNotReturnedWhenDeletedAfterListBeforeGet() {
"my-catalog-2"),
List.of());
-
metaStoreManager.setFakeEntityNotFoundIds(Set.of(catalog1.getCatalog().getId()));
+ Mockito.doAnswer(
+ invocation -> {
+ Object entityId = invocation.getArgument(2);
+ if (entityId.equals(catalog1.getCatalog().getId())) {
+ return new
EntityResult(BaseResult.ReturnStatus.ENTITY_NOT_FOUND, "");
+ }
+ return invocation.callRealMethod();
+ })
+ .when(metaStoreManager)
+ .loadEntity(Mockito.any(), Mockito.anyLong(), Mockito.anyLong(),
Mockito.any());
+
List<PolarisEntity> catalogs = polarisAdminService.listCatalogs();
assertThat(catalogs.size()).isEqualTo(1);
assertThat(catalogs.getFirst().getId()).isEqualTo(catalog2.getCatalog().getId());
}
-
- /**
- * Intended to be a delegate to TransactionalMetaStoreManagerImpl with the
ability to inject
- * faults. Currently, you can force loadEntity() to return ENTITY_NOT_FOUND
for a set of entity
- * IDs.
- */
- public static class TestPolarisMetaStoreManager extends
TransactionalMetaStoreManagerImpl {
Review Comment:
in terms of test coverage, does it matter that instead of
`TransactionalMetaStoreManagerImpl` we are now using the one from
`TestServices` (which seem to be `TreeMapTransactionalPersistenceImpl`) ?
:thinking:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]