booking-item-to-related-hosting-asset-just-1-to-1 #61
@ -116,8 +116,7 @@ public class HsBookingItemEntity implements Stringifyable, RbacObject {
|
||||
@JoinColumn(name="parentitemuuid", referencedColumnName="uuid")
|
||||
private List<HsBookingItemEntity> subBookingItems;
|
||||
|
||||
@OneToOne(mappedBy="bookingItem", optional = true)
|
||||
@NotFound(action = NotFoundAction.IGNORE)
|
||||
@OneToOne(mappedBy="bookingItem")
|
||||
private HsHostingAssetEntity relatedHostingAsset;
|
||||
|
||||
@Transient
|
||||
|
@ -177,15 +177,11 @@ class HsBookingItemRepositoryIntegrationTest extends ContextBasedTestWithCleanup
|
||||
"HsBookingItemEntity(D-1000212:D-1000212 default project, MANAGED_WEBSPACE, [2022-10-01,), separate ManagedWebspace, { Daemons: 0, Multi: 1, SSD: 100, Traffic: 50 })",
|
||||
"HsBookingItemEntity(D-1000212:D-1000212 default project, MANAGED_SERVER, [2022-10-01,), separate ManagedServer, { CPUs: 2, RAM: 8, SSD: 500, Traffic: 500 })",
|
||||
"HsBookingItemEntity(D-1000212:D-1000212 default project, PRIVATE_CLOUD, [2024-04-01,), some PrivateCloud, { CPUs: 10, HDD: 10000, RAM: 32, SSD: 4000, Traffic: 2000 })");
|
||||
assertThat(result.stream().filter(bi -> bi.getRelatedHostingAsset()!=null).map(bi -> x(bi)).findAny())
|
||||
.as("at least one relatedProject expected, but none found => fetcing relatedProject does not work")
|
||||
assertThat(result.stream().filter(bi -> bi.getRelatedHostingAsset()!=null).findAny())
|
||||
.as("at least one relatedProject expected, but none found => fetching relatedProject does not work")
|
||||
.isNotEmpty();
|
||||
}
|
||||
|
||||
HsBookingItemEntity x(HsBookingItemEntity x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void normalUser_canViewOnlyRelatedBookingItems() {
|
||||
// given:
|
||||
|
Loading…
Reference in New Issue
Block a user