2020import static org .cloudfoundry .client .v3 .LifecycleType .BUILDPACK ;
2121import static org .cloudfoundry .client .v3 .LifecycleType .DOCKER ;
2222import static org .cloudfoundry .operations .TestObjects .fill ;
23- import static org .mockito .ArgumentMatchers .any ;
2423import static org .mockito .Mockito .RETURNS_SMART_NULLS ;
2524import static org .mockito .Mockito .mock ;
2625import static org .mockito .Mockito .when ;
144143import org .cloudfoundry .doppler .LogMessage ;
145144import org .cloudfoundry .doppler .RecentLogsRequest ;
146145import org .cloudfoundry .doppler .StreamRequest ;
146+ import org .cloudfoundry .logcache .v1 .Envelope ;
147147import org .cloudfoundry .logcache .v1 .EnvelopeBatch ;
148148import org .cloudfoundry .logcache .v1 .Log ;
149149import org .cloudfoundry .logcache .v1 .LogCacheClient ;
@@ -1315,7 +1315,7 @@ void listTasks() {
13151315
13161316 @ SuppressWarnings ("deprecation" )
13171317 @ Test
1318- void logsRecent_doppler () {
1318+ void logsRecentDoppler () {
13191319 requestApplications (
13201320 this .cloudFoundryClient ,
13211321 "test-application-name" ,
@@ -1332,7 +1332,7 @@ void logsRecent_doppler() {
13321332
13331333 @ SuppressWarnings ("deprecation" )
13341334 @ Test
1335- void logsNoApp_doppler () {
1335+ void logsNoAppDoppler () {
13361336 requestApplicationsEmpty (this .cloudFoundryClient , "test-application-name" , TEST_SPACE_ID );
13371337
13381338 this .applications
@@ -1349,7 +1349,7 @@ void logsNoApp_doppler() {
13491349
13501350 @ SuppressWarnings ("deprecation" )
13511351 @ Test
1352- void logs_doppler () {
1352+ void logsDoppler () {
13531353 requestApplications (
13541354 this .cloudFoundryClient ,
13551355 "test-application-name" ,
@@ -1365,15 +1365,15 @@ void logs_doppler() {
13651365 }
13661366
13671367 @ Test
1368- void logsRecent_LogCache () {
1368+ void logsRecentLogCache () {
13691369 requestApplications (
13701370 this .cloudFoundryClient ,
13711371 "test-application-name" ,
13721372 TEST_SPACE_ID ,
13731373 "test-metadata-id" );
13741374 requestLogsRecentLogCache (this .logCacheClient , "test-metadata-id" , "test-payload" );
13751375 this .applications
1376- .logsRecent (ReadRequest .builder ().sourceId ("test-application-name " ).build ())
1376+ .logsRecent (ReadRequest .builder ().sourceId ("test-metadata-id " ).build ())
13771377 .as (StepVerifier ::create )
13781378 .expectNext (fill (Log .builder ()).type (LogType .OUT ).build ())
13791379 .expectComplete ()
@@ -1382,7 +1382,7 @@ void logsRecent_LogCache() {
13821382
13831383 @ SuppressWarnings ("deprecation" )
13841384 @ Test
1385- void logsRecentNotSet_doppler () {
1385+ void logsRecentNotSetDoppler () {
13861386 requestApplications (
13871387 this .cloudFoundryClient ,
13881388 "test-application-name" ,
@@ -5054,25 +5054,6 @@ private static void requestGetApplicationFailing(
50545054 .build ()));
50555055 }
50565056
5057- private static void requestGetApplicationTimeout (
5058- CloudFoundryClient cloudFoundryClient , String applicationId ) {
5059- when (cloudFoundryClient
5060- .applicationsV2 ()
5061- .get (
5062- org .cloudfoundry .client .v2 .applications .GetApplicationRequest
5063- .builder ()
5064- .applicationId (applicationId )
5065- .build ()))
5066- .thenReturn (
5067- Mono .just (
5068- fill (GetApplicationResponse .builder ())
5069- .entity (
5070- fill (ApplicationEntity .builder ())
5071- .packageState ("STAGING" )
5072- .build ())
5073- .build ()));
5074- }
5075-
50765057 private static void requestInstancesApplicationFailing (
50775058 CloudFoundryClient cloudFoundryClient , String applicationId ) {
50785059 when (cloudFoundryClient
@@ -5096,20 +5077,36 @@ private static void requestInstancesApplicationFailing(
50965077 .build ()));
50975078 }
50985079
5080+ private static void requestGetApplicationTimeout (
5081+ CloudFoundryClient cloudFoundryClient , String applicationId ) {
5082+ when (cloudFoundryClient
5083+ .applicationsV2 ()
5084+ .get (
5085+ org .cloudfoundry .client .v2 .applications .GetApplicationRequest
5086+ .builder ()
5087+ .applicationId (applicationId )
5088+ .build ()))
5089+ .thenReturn (
5090+ Mono .just (
5091+ fill (GetApplicationResponse .builder ())
5092+ .entity (
5093+ fill (ApplicationEntity .builder ())
5094+ .packageState ("STAGING" )
5095+ .build ())
5096+ .build ()));
5097+ }
5098+
50995099 private static void requestLogsRecentLogCache (
5100- LogCacheClient logCacheClient , String applicationName , String payload ) {
5101- when (logCacheClient .recentLogs (any ()))
5100+ LogCacheClient logCacheClient , String sourceId , String payload ) {
5101+ when (logCacheClient .recentLogs (ReadRequest . builder (). sourceId ( sourceId ). build ()))
51025102 .thenReturn (
51035103 Mono .just (
51045104 fill (ReadResponse .builder ())
51055105 .envelopes (
51065106 fill (EnvelopeBatch .builder ())
51075107 .batch (
51085108 Arrays .asList (
5109- fill (org .cloudfoundry
5110- .logcache .v1
5111- .Envelope
5112- .builder ())
5109+ fill (Envelope .builder ())
51135110 .log (
51145111 Log
51155112 .builder ()
0 commit comments