booking-item-to-related-hosting-asset-just-1-to-1 #61

Merged
hsh-michaelhoennig merged 8 commits from booking-item-to-related-hosting-asset-just-1-to-1 into master 2024-06-18 13:53:11 +02:00
Showing only changes of commit 875ff5c046 - Show all commits

View File

@ -157,7 +157,7 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
attempt(em, () -> {
context("superuser-alex@hostsharing.net");
final var found = assetRepo.findByUuid(saved.getUuid());
assertThat(found).isNotEmpty().map(HsHostingAssetEntity::getVersion).get().isEqualTo(saved.getVersion());
assertThat(found).isNotEmpty().map(HsHostingAssetEntity::toString).get().isEqualTo(saved.toString());
});
}
}
@ -181,14 +181,6 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
"HsHostingAssetEntity(MANAGED_WEBSPACE, thi01, some Webspace, MANAGED_SERVER:vm1013, D-1000313:D-1000313 default project:separate ManagedWebspace)");
}
public <R> R stopWatch(final String caption, final Supplier<R> operation) {
long start = System.nanoTime();
final R result = operation.get();
System.out.printf("StopWatch %s: %dms\n",
caption, TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start));
return result;
}
@Test
public void normalUser_canViewOnlyRelatedAsset() {
// given:
@ -197,9 +189,7 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
.findAny().orElseThrow().getUuid();
// when:
final var result = stopWatch("findAllByCriteria", () ->
assetRepo.findAllByCriteria(projectUuid, null, null)
);
final var result = assetRepo.findAllByCriteria(projectUuid, null, null);
// then:
exactlyTheseAssetsAreReturned(