Skip to content

Commit e742f32

Browse files
committed
feat: Update the code
1 parent f952c57 commit e742f32

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/DefaultApplications.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,12 +1640,9 @@ private static Flux<LogMessage> getLogs(
16401640
private static Flux<Log> getRecentLogsLogCache(
16411641
Mono<LogCacheClient> logCacheClient, ReadRequest readRequest) {
16421642
return requestLogsRecentLogCache(logCacheClient, readRequest)
1643-
.map(EnvelopeBatch::getBatch)
1644-
.map(List::stream)
1645-
.flatMapIterable(envelopeStream -> envelopeStream.collect(Collectors.toList()))
1646-
.filter(e -> e.getLog() != null)
1643+
.flatMapIterable(EnvelopeBatch::getBatch)
16471644
.sort(LOG_MESSAGE_COMPARATOR_LOG_CACHE)
1648-
.map(org.cloudfoundry.logcache.v1.Envelope::getLog);
1645+
.mapNotNull(org.cloudfoundry.logcache.v1.Envelope::getLog);
16491646
}
16501647

16511648
@SuppressWarnings("unchecked")

integration-test/src/test/java/org/cloudfoundry/operations/ApplicationsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ public void logs() throws IOException {
542542
}
543543

544544
@Test
545+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_4_v2)
545546
public void logsRecent() throws IOException {
546547
String applicationName = this.nameFactory.getApplicationName();
547548
Mono<String> applicationGuid =

0 commit comments

Comments
 (0)