Skip to content

Commit b236ad3

Browse files
jorbaumZPascal
authored andcommitted
Revert some unnecessary style changes
1 parent 7e7174b commit b236ad3

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/DefaultApplicationsTest.java

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,15 +1315,16 @@ void listTasks() {
13151315

13161316
@SuppressWarnings("deprecation")
13171317
@Test
1318-
void logsRecentDoppler() {
1318+
void logsDoppler() {
13191319
requestApplications(
13201320
this.cloudFoundryClient,
13211321
"test-application-name",
13221322
TEST_SPACE_ID,
13231323
"test-metadata-id");
1324-
requestLogsRecent(this.dopplerClient, "test-metadata-id");
1324+
requestLogsStream(this.dopplerClient, "test-metadata-id");
1325+
13251326
this.applications
1326-
.logs(LogsRequest.builder().name("test-application-name").recent(true).build())
1327+
.logs(LogsRequest.builder().name("test-application-name").recent(false).build())
13271328
.as(StepVerifier::create)
13281329
.expectNextMatches(log -> log.getMessage().equals("test-log-message-message"))
13291330
.expectComplete()
@@ -1349,15 +1350,16 @@ void logsNoAppDoppler() {
13491350

13501351
@SuppressWarnings("deprecation")
13511352
@Test
1352-
void logsDoppler() {
1353+
void logsRecentDoppler() {
13531354
requestApplications(
13541355
this.cloudFoundryClient,
13551356
"test-application-name",
13561357
TEST_SPACE_ID,
13571358
"test-metadata-id");
1358-
requestLogsStream(this.dopplerClient, "test-metadata-id");
1359+
requestLogsRecent(this.dopplerClient, "test-metadata-id");
1360+
13591361
this.applications
1360-
.logs(LogsRequest.builder().name("test-application-name").recent(false).build())
1362+
.logs(LogsRequest.builder().name("test-application-name").recent(true).build())
13611363
.as(StepVerifier::create)
13621364
.expectNextMatches(log -> log.getMessage().equals("test-log-message-message"))
13631365
.expectComplete()
@@ -1372,6 +1374,7 @@ void logsRecentLogCache() {
13721374
TEST_SPACE_ID,
13731375
"test-metadata-id");
13741376
requestLogsRecentLogCache(this.logCacheClient, "test-metadata-id", "test-payload");
1377+
13751378
this.applications
13761379
.logsRecent(ReadRequest.builder().sourceId("test-metadata-id").build())
13771380
.as(StepVerifier::create)
@@ -5096,31 +5099,6 @@ private static void requestGetApplicationTimeout(
50965099
.build()));
50975100
}
50985101

5099-
private static void requestLogsRecentLogCache(
5100-
LogCacheClient logCacheClient, String sourceId, String payload) {
5101-
when(logCacheClient.recentLogs(ReadRequest.builder().sourceId(sourceId).build()))
5102-
.thenReturn(
5103-
Mono.just(
5104-
fill(ReadResponse.builder())
5105-
.envelopes(
5106-
fill(EnvelopeBatch.builder())
5107-
.batch(
5108-
Arrays.asList(
5109-
fill(Envelope.builder())
5110-
.log(
5111-
Log
5112-
.builder()
5113-
.payload(
5114-
payload)
5115-
.type(
5116-
LogType
5117-
.OUT)
5118-
.build())
5119-
.build()))
5120-
.build())
5121-
.build()));
5122-
}
5123-
51245102
private static void requestGetApplicationV3Buildpack(
51255103
CloudFoundryClient cloudFoundryClient, String applicationId) {
51265104
when(cloudFoundryClient
@@ -5367,8 +5345,10 @@ private static void requestListTasksEmpty(
53675345
.build()));
53685346
}
53695347

5370-
private static void requestLogsStream(DopplerClient dopplerClient, String applicationId) {
5371-
when(dopplerClient.stream(StreamRequest.builder().applicationId(applicationId).build()))
5348+
@SuppressWarnings("deprecation")
5349+
private static void requestLogsRecent(DopplerClient dopplerClient, String applicationId) {
5350+
when(dopplerClient.recentLogs(
5351+
RecentLogsRequest.builder().applicationId(applicationId).build()))
53725352
.thenReturn(
53735353
Flux.just(
53745354
org.cloudfoundry.doppler.Envelope.builder()
@@ -5379,10 +5359,33 @@ private static void requestLogsStream(DopplerClient dopplerClient, String applic
53795359
.build()));
53805360
}
53815361

5382-
@SuppressWarnings("deprecation")
5383-
private static void requestLogsRecent(DopplerClient dopplerClient, String applicationId) {
5384-
when(dopplerClient.recentLogs(
5385-
RecentLogsRequest.builder().applicationId(applicationId).build()))
5362+
private static void requestLogsRecentLogCache(
5363+
LogCacheClient logCacheClient, String sourceId, String payload) {
5364+
when(logCacheClient.recentLogs(ReadRequest.builder().sourceId(sourceId).build()))
5365+
.thenReturn(
5366+
Mono.just(
5367+
fill(ReadResponse.builder())
5368+
.envelopes(
5369+
fill(EnvelopeBatch.builder())
5370+
.batch(
5371+
Arrays.asList(
5372+
fill(Envelope.builder())
5373+
.log(
5374+
Log
5375+
.builder()
5376+
.payload(
5377+
payload)
5378+
.type(
5379+
LogType
5380+
.OUT)
5381+
.build())
5382+
.build()))
5383+
.build())
5384+
.build()));
5385+
}
5386+
5387+
private static void requestLogsStream(DopplerClient dopplerClient, String applicationId) {
5388+
when(dopplerClient.stream(StreamRequest.builder().applicationId(applicationId).build()))
53865389
.thenReturn(
53875390
Flux.just(
53885391
org.cloudfoundry.doppler.Envelope.builder()

0 commit comments

Comments
 (0)