Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This commit is contained in:
parent
2730ae4a13
commit
78355bb225
|
@ -236,12 +236,12 @@ public final class CloudEventV03 extends BaseCloudEvent {
|
|||
"id='" + id + '\'' +
|
||||
", source=" + source +
|
||||
", type='" + type + '\'' +
|
||||
", datacontenttype='" + datacontenttype + '\'' +
|
||||
", schemaurl=" + schemaurl +
|
||||
", subject='" + subject + '\'' +
|
||||
", time=" + time +
|
||||
", data=" + getData() +
|
||||
", extensions" + this.extensions +
|
||||
((datacontenttype != null) ? ", datacontenttype='" + datacontenttype + '\'' : "") +
|
||||
((schemaurl != null) ? ", schemaurl=" + schemaurl : "") +
|
||||
((subject != null) ? ", subject='" + subject + '\'' : "") +
|
||||
((time != null) ? ", time=" + time : "") +
|
||||
((getData() != null) ? ", data=" + getData() : "") +
|
||||
", extensions=" + this.extensions +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,11 +223,11 @@ public final class CloudEventV1 extends BaseCloudEvent {
|
|||
"id='" + id + '\'' +
|
||||
", source=" + source +
|
||||
", type='" + type + '\'' +
|
||||
", datacontenttype='" + datacontenttype + '\'' +
|
||||
", dataschema=" + dataschema +
|
||||
", subject='" + subject + '\'' +
|
||||
", time=" + time +
|
||||
", data=" + getData() +
|
||||
((datacontenttype != null) ? ", datacontenttype='" + datacontenttype + '\'' : "") +
|
||||
((dataschema != null) ? ", dataschema=" + dataschema : "") +
|
||||
((subject != null) ? ", subject='" + subject + '\'' : "") +
|
||||
((time != null) ? ", time=" + time : "") +
|
||||
((getData() != null) ? ", data=" + getData() : "") +
|
||||
", extensions=" + this.extensions +
|
||||
'}';
|
||||
}
|
||||
|
|
|
@ -91,4 +91,28 @@ public class CloudEventImplTest {
|
|||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToStringV1() {
|
||||
CloudEvent event = CloudEventBuilder.v1()
|
||||
.withId(ID)
|
||||
.withType(TYPE)
|
||||
.withSource(SOURCE)
|
||||
.build();
|
||||
|
||||
assertThat(event.toString())
|
||||
.doesNotContain("time");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToStringV03() {
|
||||
CloudEvent event = CloudEventBuilder.v03()
|
||||
.withId(ID)
|
||||
.withType(TYPE)
|
||||
.withSource(SOURCE)
|
||||
.build();
|
||||
|
||||
assertThat(event.toString())
|
||||
.doesNotContain("time");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue