156
156
import org .cloudfoundry .util .DateUtils ;
157
157
import org .cloudfoundry .util .FluentMap ;
158
158
import org .cloudfoundry .util .ResourceMatchingUtils ;
159
+ import org .junit .jupiter .api .Disabled ;
159
160
import org .junit .jupiter .api .Test ;
160
161
import org .springframework .core .io .ClassPathResource ;
161
162
import reactor .core .publisher .Flux ;
@@ -1325,7 +1326,7 @@ void logs() {
1325
1326
requestLogsRecentLogCache (this .logCacheClient , "test-application-name" );
1326
1327
1327
1328
this .applications
1328
- .logs (ReadRequest .builder ().sourceId ("test-application-name" ).build ())
1329
+ .logs (LogsRequest .builder ().name ("test-application-name" ). recent ( true ).build ())
1329
1330
.as (StepVerifier ::create )
1330
1331
.expectNextMatches (log -> log .getPayload ().equals ("test-payload" ))
1331
1332
.expectComplete ()
@@ -1337,7 +1338,7 @@ void logsNoApp() {
1337
1338
requestApplicationsEmpty (this .cloudFoundryClient , "test-application-name" , TEST_SPACE_ID );
1338
1339
1339
1340
this .applications
1340
- .logs (ReadRequest .builder ().sourceId ("test-application-name" ).build ())
1341
+ .logs (LogsRequest .builder ().name ("test-application-name" ).build ())
1341
1342
.as (StepVerifier ::create )
1342
1343
.consumeErrorWith (
1343
1344
t ->
@@ -1348,39 +1349,40 @@ void logsNoApp() {
1348
1349
.verify (Duration .ofSeconds (5 ));
1349
1350
}
1350
1351
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
+ }
1384
1386
1385
1387
@ Test
1386
1388
void pushDocker () {
@@ -5262,14 +5264,16 @@ private static void requestLogsRecentLogCache(LogCacheClient logCacheClient, Str
5262
5264
any ()))
5263
5265
.thenReturn (
5264
5266
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 ()));
5273
5277
}
5274
5278
5275
5279
private static void requestLogsStream (DopplerClient dopplerClient , String applicationId ) {
0 commit comments