use of com.optimizely.ab.event.internal.payload.EventBatch in project java-sdk by optimizely.
the class JsonSerializerTest method serializeConversionWithSessionId.
@Test
public void serializeConversionWithSessionId() throws IOException {
EventBatch conversion = generateConversionWithSessionId();
// can't compare JSON strings since orders could vary so compare JSONObjects instead
JSONObject actual = new JSONObject(serializer.serialize(conversion));
JSONObject expected = new JSONObject(generateConversionWithSessionIdJson());
assertTrue(actual.similar(expected));
}
use of com.optimizely.ab.event.internal.payload.EventBatch in project java-sdk by optimizely.
the class JsonSerializerTest method serializeImpressionWithSessionId.
@Test
public void serializeImpressionWithSessionId() throws IOException {
EventBatch impression = generateImpressionWithSessionId();
// can't compare JSON strings since orders could vary so compare JSONObjects instead
JSONObject actual = new JSONObject(serializer.serialize(impression));
JSONObject expected = new JSONObject(generateImpressionWithSessionIdJson());
assertTrue(actual.similar(expected));
}
use of com.optimizely.ab.event.internal.payload.EventBatch in project java-sdk by optimizely.
the class JsonSerializerTest method serializeImpression.
@Test
public void serializeImpression() throws IOException {
EventBatch impression = generateImpression();
// can't compare JSON strings since orders could vary so compare JSONObjects instead
JSONObject actual = new JSONObject(serializer.serialize(impression));
JSONObject expected = new JSONObject(generateImpressionJson());
assertTrue(actual.similar(expected));
}
use of com.optimizely.ab.event.internal.payload.EventBatch in project java-sdk by optimizely.
the class JacksonSerializerTest method serializeImpression.
@Test
public void serializeImpression() throws IOException {
EventBatch impression = generateImpression();
// can't compare JSON strings since orders could vary so compare objects instead
EventBatch actual = mapper.readValue(serializer.serialize(impression), EventBatch.class);
EventBatch expected = mapper.readValue(generateImpressionJson(), EventBatch.class);
assertThat(actual, is(expected));
}
use of com.optimizely.ab.event.internal.payload.EventBatch in project java-sdk by optimizely.
the class JacksonSerializerTest method serializeConversionWithSessionId.
@Test
public void serializeConversionWithSessionId() throws IOException {
EventBatch conversion = generateConversionWithSessionId();
// can't compare JSON strings since orders could vary so compare objects instead
EventBatch actual = mapper.readValue(serializer.serialize(conversion), EventBatch.class);
EventBatch expected = mapper.readValue(generateConversionWithSessionIdJson(), EventBatch.class);
assertThat(actual, is(expected));
}
Aggregations