Skip to content

Instantly share code, notes, and snippets.

@avarabyeu
Created March 2, 2018 13:36
Show Gist options
  • Save avarabyeu/d9a59c5518c1626134e73e45e536f3f9 to your computer and use it in GitHub Desktop.
Save avarabyeu/d9a59c5518c1626134e73e45e536f3f9 to your computer and use it in GitHub Desktop.
public static class ReportPortal4Listener extends BaseTestNGListener {
public ExtendedListener() {
super(Injector.create(
new ConfigurationModule(),
override(new ReportPortalClientModule()).with((Module) binder -> binder.bind(Serializer.class).toProvider(() -> {
ObjectMapper om = new ObjectMapper();
om.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"));
om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return new JacksonSerializer(om);
}), new TestNGAgentModule())
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment