Compare commits

..

No commits in common. "875ff5c04687f07ce10bbeac2abccbf8b49ab09a" and "8b0e6863741d76edd76790fe024fcb70b8998981" have entirely different histories.

View File

@ -154,11 +154,8 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
} }
private void assertThatAssetIsPersisted(final HsHostingAssetEntity saved) { private void assertThatAssetIsPersisted(final HsHostingAssetEntity saved) {
attempt(em, () -> {
context("superuser-alex@hostsharing.net");
final var found = assetRepo.findByUuid(saved.getUuid()); final var found = assetRepo.findByUuid(saved.getUuid());
assertThat(found).isNotEmpty().map(HsHostingAssetEntity::toString).get().isEqualTo(saved.toString()); assertThat(found).isNotEmpty().map(HsHostingAssetEntity::getVersion).get().isEqualTo(saved.getVersion());
});
} }
} }
@ -181,6 +178,14 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
"HsHostingAssetEntity(MANAGED_WEBSPACE, thi01, some Webspace, MANAGED_SERVER:vm1013, D-1000313:D-1000313 default project:separate ManagedWebspace)"); "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 @Test
public void normalUser_canViewOnlyRelatedAsset() { public void normalUser_canViewOnlyRelatedAsset() {
// given: // given:
@ -189,7 +194,9 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
.findAny().orElseThrow().getUuid(); .findAny().orElseThrow().getUuid();
// when: // when:
final var result = assetRepo.findAllByCriteria(projectUuid, null, null); final var result = stopWatch("findAllByCriteria", () ->
assetRepo.findAllByCriteria(projectUuid, null, null)
);
// then: // then:
exactlyTheseAssetsAreReturned( exactlyTheseAssetsAreReturned(