snowplow-incubator / common-streams

Other
1 stars 0 forks source link

Extend coverage of Transform.transformEventUnstructured unit tests #48

Closed spenes closed 11 months ago

spenes commented 11 months ago

This PR extends coverage of Transform.transformEventUnstructured unit tests to check every possible atomic field is transformed to the correct type with the correct value.

It uses snowplow-event-generator to generate events. However, current latest version of Event Generator (0.6.0) doesn't populate some of the event fields at all. In order to populate all event fields, I've made some changes on Event Generator and published 0.6.1-rc2 version of Event Generator with those changes. This PR is using rc version at the moment. Event Generator version will be made 0.6.1 when it is published.

benjben commented 11 months ago

Hey @spenes , I took a deeper look and I think that:

spenes commented 11 months ago

@benjben This PR focuses on Transform.transformEventUnstructured. failForResolverErrors, failForResolverErrors and forEntity functions aren't used in transformEventUnstructured.

About the forMoney function, we have test for failure scenario. Do you have something specific in mind to increase the coverage ?

benjben commented 11 months ago

@spenes about forMoney, there are 2 cases that can lead to an error and ATM we only test one (I assume ArithmeticException)

spenes commented 11 months ago

@benjben I've added second test for that. Could you give it a look ?