Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ abstract class _ListEventsRequest extends PaginatedRequest {
@Nullable
abstract List<String> getActees();

/**
* The organization id
*/
@FilterParameter("organization_guid")
@Nullable
abstract List<String> getOrganizationId();

/**
* The space id
*/
@FilterParameter("space_guid")
@Nullable
abstract List<String> getSpaceId();

/**
* The timestamps
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,42 @@ public void listFilterByType() {
.verify(Duration.ofMinutes(5));
}

@Test
public void listFilterByOrganizationId(){
getFirstEvent(this.cloudFoundryClient)
.flatMap(resource -> Mono.zip(
Mono.just(resource),
this.cloudFoundryClient.events()
.list(ListEventsRequest.builder()
.spaceId(ResourceUtils.getEntity(resource).getOrganizationId())
.build())
.flatMapMany(ResourceUtils::getResources)
.next()
))
.as(StepVerifier::create)
.consumeNextWith(tupleEquality())
.expectComplete()
.verify(Duration.ofMinutes(5));
}

@Test
public void listFilterBySpaceId() {
getFirstEvent(this.cloudFoundryClient)
.flatMap(resource -> Mono.zip(
Mono.just(resource),
this.cloudFoundryClient.events()
.list(ListEventsRequest.builder()
.spaceId(ResourceUtils.getEntity(resource).getSpaceId())
.build())
.flatMapMany(ResourceUtils::getResources)
.next()
))
.as(StepVerifier::create)
.consumeNextWith(tupleEquality())
.expectComplete()
.verify(Duration.ofMinutes(5));
}

private static Mono<EventResource> getFirstEvent(CloudFoundryClient cloudFoundryClient) {
return listEvents(cloudFoundryClient)
.next();
Expand Down