156156import org .cloudfoundry .util .DateUtils ;
157157import org .cloudfoundry .util .FluentMap ;
158158import org .cloudfoundry .util .ResourceMatchingUtils ;
159+ import org .junit .jupiter .api .Disabled ;
159160import org .junit .jupiter .api .Test ;
160161import org .springframework .core .io .ClassPathResource ;
161162import reactor .core .publisher .Flux ;
@@ -1325,7 +1326,7 @@ void logs() {
13251326 requestLogsRecentLogCache (this .logCacheClient , "test-application-name" );
13261327
13271328 this .applications
1328- .logs (ReadRequest .builder ().sourceId ("test-application-name" ).build ())
1329+ .logs (LogsRequest .builder ().name ("test-application-name" ). recent ( true ).build ())
13291330 .as (StepVerifier ::create )
13301331 .expectNextMatches (log -> log .getPayload ().equals ("test-payload" ))
13311332 .expectComplete ()
@@ -1337,7 +1338,7 @@ void logsNoApp() {
13371338 requestApplicationsEmpty (this .cloudFoundryClient , "test-application-name" , TEST_SPACE_ID );
13381339
13391340 this .applications
1340- .logs (ReadRequest .builder ().sourceId ("test-application-name" ).build ())
1341+ .logs (LogsRequest .builder ().name ("test-application-name" ).build ())
13411342 .as (StepVerifier ::create )
13421343 .consumeErrorWith (
13431344 t ->
@@ -1348,39 +1349,40 @@ void logsNoApp() {
13481349 .verify (Duration .ofSeconds (5 ));
13491350 }
13501351
1351- @ Test
1352- void logsRecent () {
1353- requestApplications (
1354- this .cloudFoundryClient ,
1355- "test-application-name" ,
1356- TEST_SPACE_ID ,
1357- "test-metadata-id" );
1358- requestLogsRecentLogCache (this .logCacheClient , "test-metadata-id" );
1359-
1360- this .applications
1361- .logs (ReadRequest .builder ().sourceId ("test-application-name" ).build ())
1362- .as (StepVerifier ::create )
1363- .expectNext (fill (Log .builder (), "log-message-" ).build ())
1364- .expectComplete ()
1365- .verify (Duration .ofSeconds (5 ));
1366- }
1367-
1368- @ Test
1369- void logsRecentNotSet () {
1370- requestApplications (
1371- this .cloudFoundryClient ,
1372- "test-application-name" ,
1373- TEST_SPACE_ID ,
1374- "test-metadata-id" );
1375- requestLogsStream (this .dopplerClient , "test-metadata-id" );
1376-
1377- this .applications
1378- .logs (ReadRequest .builder ().sourceId ("test-application-name" ).build ())
1379- .as (StepVerifier ::create )
1380- .expectNext (fill (Log .builder (), "log-message-" ).build ())
1381- .expectComplete ()
1382- .verify (Duration .ofSeconds (5 ));
1383- }
1352+ // TODO: it's not passing since recentLogs is not properly implemented yet with logcacheclient
1353+ @ Test
1354+ void logsRecent () {
1355+ requestApplications (
1356+ this .cloudFoundryClient ,
1357+ "test-application-name" ,
1358+ TEST_SPACE_ID ,
1359+ "test-metadata-id" );
1360+ requestLogsRecentLogCache (this .logCacheClient , "test-metadata-id" );
1361+
1362+ this .applications
1363+ .logs (LogsRequest .builder ().name ("test-application-name" ).build ())
1364+ .as (StepVerifier ::create )
1365+ .expectNext (fill (Log .builder (), "log-message-" ).build ())
1366+ .expectComplete ()
1367+ .verify (Duration .ofSeconds (5 ));
1368+ }
1369+ // TODO: it's not passing since recentLogs is not properly implemented yet with logcacheclient
1370+ @ Test
1371+ void logsRecentNotSet () {
1372+ requestApplications (
1373+ this .cloudFoundryClient ,
1374+ "test-application-name" ,
1375+ TEST_SPACE_ID ,
1376+ "test-metadata-id" );
1377+ requestLogsStream (this .dopplerClient , "test-metadata-id" );
1378+
1379+ this .applications
1380+ .logs (LogsRequest .builder ().name ("test-application-name" ).build ())
1381+ .as (StepVerifier ::create )
1382+ .expectNext (fill (Log .builder (), "log-message-" ).build ())
1383+ .expectComplete ()
1384+ .verify (Duration .ofSeconds (5 ));
1385+ }
13841386
13851387 @ Test
13861388 void pushDocker () {
@@ -5262,14 +5264,16 @@ private static void requestLogsRecentLogCache(LogCacheClient logCacheClient, Str
52625264 any ()))
52635265 .thenReturn (
52645266 Mono .just (fill (ReadResponse .builder ())
5265- .envelopes (fill (EnvelopeBatch .builder ())
5266- .batch (fill (org .cloudfoundry .logcache .v1 .Envelope .builder ())
5267- .log (fill (Log .builder ())
5268- .payload ("test-payload" )
5269- .type (LogType .OUT ).build ())
5270- .build ())
5271- .build ())
5272- .build ()));
5267+ .envelopes (fill (EnvelopeBatch .builder ())
5268+ .batch (fill (org .cloudfoundry .logcache .v1 .Envelope
5269+ .builder ())
5270+ .log (fill (Log .builder ())
5271+ .payload ("test-payload" )
5272+ .type (LogType .OUT )
5273+ .build ())
5274+ .build ())
5275+ .build ())
5276+ .build ()));
52735277 }
52745278
52755279 private static void requestLogsStream (DopplerClient dopplerClient , String applicationId ) {
0 commit comments