Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Update test to retrieve json format #2378

Merged
merged 1 commit into from
May 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.example;

import com.google.cloud.logging.Payload.JsonPayload;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -108,7 +109,8 @@ public void testLogRecordedInStackDriver() {
});

List<String> logContents = logEntries.stream()
.map((logEntry) -> ((StringPayload) logEntry.getPayload()).getData())
.map((logEntry) -> (String) ((JsonPayload) logEntry.getPayload())
.getDataAsMap().get("message"))
.collect(Collectors.toList());

assertThat(logContents).containsExactlyInAnyOrder(
Expand Down