use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class ShortTermDuplicateMemoryTest method shouldForgetAboutRequestHashesAfterSomeTime.
@Test
public void shouldForgetAboutRequestHashesAfterSomeTime() throws IOException, InterruptedException {
EventPayload payload;
request(1);
payload = server.waitForEvent();
assertEquals(false, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
request(0);
payload = server.waitForEvent();
assertEquals(false, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
request(1);
payload = server.waitForEvent();
assertEquals(true, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
request(2);
payload = server.waitForEvent();
assertEquals(false, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
request(1);
payload = server.waitForEvent();
assertEquals(false, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class ShortTermDuplicateMemoryTest method shouldFlagDuplicateRequests.
@Test
public void shouldFlagDuplicateRequests() throws IOException, InterruptedException {
EventPayload payload;
request(0);
payload = server.waitForEvent();
assertEquals(false, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
request(1);
payload = server.waitForEvent();
assertEquals(false, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
request(0);
payload = server.waitForEvent();
assertEquals(true, payload.event.exchange.getAttachment(DUPLICATE_EVENT_KEY));
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class DslRecordMapperTest method shouldStopOnCondition.
@Test
public void shouldStopOnCondition() throws IOException, InterruptedException {
setupServer("shorthand-conditional-stop.groovy");
final EventPayload event = request("http://www.example.com");
assertEquals("happened", event.record.get("client"));
assertNull(event.record.get("session"));
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class DslRecordMapperTest method shouldStopOnConditionClosureSyntax.
@Test
public void shouldStopOnConditionClosureSyntax() throws IOException, InterruptedException {
setupServer("shorthand-conditional-stop-closure.groovy");
final EventPayload event = request("http://www.example.com");
assertEquals("happened", event.record.get("client"));
assertNull(event.record.get("session"));
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class DslRecordMapperTest method shouldMapLiteralsOntoCorrectTypes.
@Test
public void shouldMapLiteralsOntoCorrectTypes() throws IOException, InterruptedException {
setupServer("correct-types-literal.groovy");
final EventPayload event = request("http://www.example.com/correct");
assertEquals("string value", event.record.get("queryparam"));
assertEquals(true, event.record.get("queryparamBoolean"));
assertEquals(42L, event.record.get("queryparamLong"));
assertEquals(42, event.record.get("pathInteger"));
assertEquals(42.0, event.record.get("queryparamDouble"));
}
Aggregations