Skip to content

Commit f389bd3

Browse files
jorbaumZPascal
authored andcommitted
Revert some unnecessary style changes
1 parent 08acf88 commit f389bd3

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
@@ -1316,15 +1316,16 @@ void listTasks() {
13161316

13171317
@SuppressWarnings("deprecation")
13181318
@Test
1319-
void logsRecentDoppler() {
1319+
void logsDoppler() {
13201320
requestApplications(
13211321
this.cloudFoundryClient,
13221322
"test-application-name",
13231323
TEST_SPACE_ID,
13241324
"test-metadata-id");
1325-
requestLogsRecent(this.dopplerClient, "test-metadata-id");
1325+
requestLogsStream(this.dopplerClient, "test-metadata-id");
1326+
13261327
this.applications
1327-
.logs(LogsRequest.builder().name("test-application-name").recent(true).build())
1328+
.logs(LogsRequest.builder().name("test-application-name").recent(false).build())
13281329
.as(StepVerifier::create)
13291330
.expectNextMatches(log -> log.getMessage().equals("test-log-message-message"))
13301331
.expectComplete()
@@ -1350,15 +1351,16 @@ void logsNoAppDoppler() {
13501351

13511352
@SuppressWarnings("deprecation")
13521353
@Test
1353-
void logsDoppler() {
1354+
void logsRecentDoppler() {
13541355
requestApplications(
13551356
this.cloudFoundryClient,
13561357
"test-application-name",
13571358
TEST_SPACE_ID,
13581359
"test-metadata-id");
1359-
requestLogsStream(this.dopplerClient, "test-metadata-id");
1360+
requestLogsRecent(this.dopplerClient, "test-metadata-id");
1361+
13601362
this.applications
1361-
.logs(LogsRequest.builder().name("test-application-name").recent(false).build())
1363+
.logs(LogsRequest.builder().name("test-application-name").recent(true).build())
13621364
.as(StepVerifier::create)
13631365
.expectNextMatches(log -> log.getMessage().equals("test-log-message-message"))
13641366
.expectComplete()
@@ -1373,6 +1375,7 @@ void logsRecentLogCache() {
13731375
TEST_SPACE_ID,
13741376
"test-metadata-id");
13751377
requestLogsRecentLogCache(this.logCacheClient, "test-metadata-id", "test-payload");
1378+
13761379
this.applications
13771380
.logsRecent(ReadRequest.builder().sourceId("test-metadata-id").build())
13781381
.as(StepVerifier::create)
@@ -5097,31 +5100,6 @@ private static void requestGetApplicationTimeout(
50975100
.build()));
50985101
}
50995102

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

5371-
private static void requestLogsStream(DopplerClient dopplerClient, String applicationId) {
5372-
when(dopplerClient.stream(StreamRequest.builder().applicationId(applicationId).build()))
5349+
@SuppressWarnings("deprecation")
5350+
private static void requestLogsRecent(DopplerClient dopplerClient, String applicationId) {
5351+
when(dopplerClient.recentLogs(
5352+
RecentLogsRequest.builder().applicationId(applicationId).build()))
53735353
.thenReturn(
53745354
Flux.just(
53755355
org.cloudfoundry.doppler.Envelope.builder()
@@ -5380,10 +5360,33 @@ private static void requestLogsStream(DopplerClient dopplerClient, String applic
53805360
.build()));
53815361
}
53825362

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

0 commit comments

Comments
 (0)