use of com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage in project intellij-redhat-telemetry by redhat-developer.
the class TelemetryMessageBuilderTest method send_should_set_duration.
@Test
public void send_should_set_duration() throws InterruptedException {
// given
ActionMessage message = builder.action("jolly jumper");
// when
TelemetryEvent event = message.send();
// then dont override existing duration
assertThat(TimeUtils.toDuration(event.getProperties().get(PROP_DURATION))).isNotNull();
}
use of com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage in project intellij-redhat-telemetry by redhat-developer.
the class TelemetryMessageBuilderTest method error_should_anonymize_tmpdir.
@Test
public void error_should_anonymize_tmpdir() {
// given
ActionMessage message = builder.action("the smurfs");
// when
String junkyard = AnonymizeUtils.HOME_DIR;
message.error("there's no " + junkyard + " in the smurf village");
// then
assertThat(message.getError()).doesNotContain(junkyard);
}
use of com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage in project intellij-redhat-telemetry by redhat-developer.
the class TelemetryMessageBuilderTest method error_should_anonymize_IP_address.
@Test
public void error_should_anonymize_IP_address() {
// given
ActionMessage message = builder.action("the smurfs");
// when
String IP = "192.168.1.42";
message.error("the smurf village must be kept secret, that's why their IP " + IP + " is anonymized");
// then
assertThat(message.getError()).doesNotContain(IP);
}
use of com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage in project intellij-redhat-telemetry by redhat-developer.
the class TelemetryMessageBuilderTest method send_should_set_result.
@Test
public void send_should_set_result() throws InterruptedException {
// given
ActionMessage message = builder.action("jolly jumper");
// when
TelemetryEvent event = message.send();
// then
assertThat(event.getProperties().get(PROP_RESULT)).isNotNull();
}
use of com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage in project intellij-redhat-telemetry by redhat-developer.
the class TelemetryMessageBuilderTest method send_should_send_to_same_facade_instance.
@Test
public void send_should_send_to_same_facade_instance() {
// given
ActionMessage message1 = builder.action("gargamel");
ActionMessage message2 = builder.action("azrael");
ActionMessage message3 = builder.action("papa smurf");
// when
message1.send();
message2.send();
message3.send();
// then
verify(serviceFacadeMock, times(3)).send(any(TelemetryEvent.class));
}
Aggregations