Skip to content

Commit

Permalink
MessageUtils.toJson
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Smelov committed Jun 12, 2024
1 parent 6c2c1b5 commit 490bae3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/java/com/exactpro/th2/estore/ProtoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
import com.exactpro.th2.common.grpc.EventIDOrBuilder;
import com.exactpro.th2.common.grpc.EventStatus;
import com.exactpro.th2.common.grpc.MessageIDOrBuilder;
import com.exactpro.th2.common.message.MessageUtils;
import com.exactpro.th2.common.util.StorageUtils;
import com.google.common.base.Strings;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Timestamp;
import com.google.protobuf.util.JsonFormat;

import java.util.Collection;
import java.util.Comparator;
Expand All @@ -50,14 +49,7 @@ public static StoredMessageId toStoredMessageId(MessageIDOrBuilder messageId) {
public static StoredTestEventId toCradleEventID(EventIDOrBuilder protoEventID) {
String id = protoEventID.getId();
if (Strings.isNullOrEmpty(id)) {
String eventString;
try {
eventString = JsonFormat.printer().print(protoEventID);
} catch (InvalidProtocolBufferException e) {
eventString = protoEventID.toString();
}

throw new IllegalArgumentException("No unique identifier specified for event: " + eventString);
throw new IllegalArgumentException("No unique identifier specified for event: " + MessageUtils.toJson(protoEventID));
}

return new StoredTestEventId(
Expand Down

0 comments on commit 490bae3

Please sign in to comment.