Skip to content

Commit

Permalink
make event test more predictable
Browse files Browse the repository at this point in the history
  • Loading branch information
littleaj committed Jul 6, 2019
1 parent 3cc135c commit 8f3ce1e
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.util.Comparator;
import java.util.List;

public class CoreAndFilterTests extends AiSmokeTest {
Expand Down Expand Up @@ -65,11 +66,18 @@ public void testTrackEvent() throws Exception {
expectedItems, totalItems);

// TODO get event data envelope and verify value
EventData d = getTelemetryDataForType(0, "EventData");
final List<EventData> events = mockedIngestion.getTelemetryDataByType("EventData");
events.sort(new Comparator<EventData>() {
@Override
public int compare(EventData o1, EventData o2) {
return o1.getName().compareTo(o2.getName());
}
});
EventData d = events.get(1);
final String name = "EventDataTest";
assertEquals(name, d.getName());

EventData d2 = getTelemetryDataForType(1, "EventData");
EventData d2 = events.get(0);

final String expectedname = "EventDataPropertyTest";
final String expectedProperties = "value";
Expand Down

0 comments on commit 8f3ce1e

Please sign in to comment.