fix(warehouse): allow platform resource scope
This commit is contained in:
@@ -35,6 +35,20 @@ import static org.mockito.Mockito.when;
|
||||
class LocationResourceServiceTest {
|
||||
@MockBean private LocationRepository repository;
|
||||
@Resource private LocationResourceService service;
|
||||
|
||||
@Test
|
||||
void supportsPlatformScopedWarehouseResourceQueries() {
|
||||
WarehouseEntity platformWarehouse = warehouse();
|
||||
platformWarehouse.setTenantId(0L);
|
||||
when(repository.findWarehouse(0L, 88L)).thenReturn(platformWarehouse);
|
||||
when(repository.findAvailable(0L, 88L, 10)).thenReturn(List.of());
|
||||
when(repository.findReservationsByBusiness(0L, "firstleg-service", 901L)).thenReturn(List.of());
|
||||
when(repository.findOccupanciesByBusiness(0L, "firstleg-service", 901L)).thenReturn(List.of());
|
||||
|
||||
assertThat(service.findAvailable(0L, 88L, 10)).isEmpty();
|
||||
assertThat(service.findActiveResources(0L, "firstleg-service", 901L)).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldHandleCase01() {
|
||||
when(repository.findWarehouse(10001L, 88L)).thenReturn(warehouse());
|
||||
|
||||
Reference in New Issue
Block a user