Kafka test fix due rel 1.0 update
Signed-off-by: clemensv <clemensv@microsoft.com>
This commit is contained in:
parent
527ab33deb
commit
f34f49c66e
|
@ -27,7 +27,7 @@ namespace CloudNative.CloudEvents.UnitTests
|
||||||
|
|
||||||
var jsonEventFormatter = new JsonEventFormatter();
|
var jsonEventFormatter = new JsonEventFormatter();
|
||||||
|
|
||||||
var cloudEvent = new CloudEvent(CloudEventsSpecVersion.V0_3,
|
var cloudEvent = new CloudEvent(CloudEventsSpecVersion.V1_0,
|
||||||
"com.github.pull.create",
|
"com.github.pull.create",
|
||||||
source: new Uri("https://github.com/cloudevents/spec/pull"),
|
source: new Uri("https://github.com/cloudevents/spec/pull"),
|
||||||
subject: "123")
|
subject: "123")
|
||||||
|
@ -40,7 +40,6 @@ namespace CloudNative.CloudEvents.UnitTests
|
||||||
|
|
||||||
var attrs = cloudEvent.GetAttributes();
|
var attrs = cloudEvent.GetAttributes();
|
||||||
attrs["comexampleextension1"] = "value";
|
attrs["comexampleextension1"] = "value";
|
||||||
attrs["comexampleextension2"] = new { othervalue = 5 };
|
|
||||||
|
|
||||||
var message = new KafkaCloudEventMessage(cloudEvent, ContentMode.Structured, new JsonEventFormatter());
|
var message = new KafkaCloudEventMessage(cloudEvent, ContentMode.Structured, new JsonEventFormatter());
|
||||||
|
|
||||||
|
@ -66,7 +65,6 @@ namespace CloudNative.CloudEvents.UnitTests
|
||||||
|
|
||||||
var attr = receivedCloudEvent.GetAttributes();
|
var attr = receivedCloudEvent.GetAttributes();
|
||||||
Assert.Equal("value", (string)attr["comexampleextension1"]);
|
Assert.Equal("value", (string)attr["comexampleextension1"]);
|
||||||
Assert.Equal(5, (int)((dynamic)attr["comexampleextension2"]).othervalue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -89,7 +87,6 @@ namespace CloudNative.CloudEvents.UnitTests
|
||||||
|
|
||||||
var attrs = cloudEvent.GetAttributes();
|
var attrs = cloudEvent.GetAttributes();
|
||||||
attrs["comexampleextension1"] = "value";
|
attrs["comexampleextension1"] = "value";
|
||||||
attrs["comexampleextension2"] = new { othervalue = 5 };
|
|
||||||
cloudEvent.Extension<PartitioningExtension>().PartitioningKeyValue = "hello much wow";
|
cloudEvent.Extension<PartitioningExtension>().PartitioningKeyValue = "hello much wow";
|
||||||
|
|
||||||
var message = new KafkaCloudEventMessage(cloudEvent, ContentMode.Binary, new JsonEventFormatter());
|
var message = new KafkaCloudEventMessage(cloudEvent, ContentMode.Binary, new JsonEventFormatter());
|
||||||
|
@ -115,7 +112,6 @@ namespace CloudNative.CloudEvents.UnitTests
|
||||||
|
|
||||||
var attr = receivedCloudEvent.GetAttributes();
|
var attr = receivedCloudEvent.GetAttributes();
|
||||||
Assert.Equal("value", (string)attr["comexampleextension1"]);
|
Assert.Equal("value", (string)attr["comexampleextension1"]);
|
||||||
Assert.Equal(5, (int)((dynamic)attr["comexampleextension2"]).othervalue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class HeadersConverter : JsonConverter
|
private class HeadersConverter : JsonConverter
|
||||||
|
|
Loading…
Reference in New Issue