Optimizely allows to obtain the ID of the anonymous user (even if the user is logged in). One of the example of the usage is merging cart when the user logs in.
Optimizely invokes its internal validators for the cart processing by default. This article describes how to skip this validation in scenarios where custom validation logic is in place, or we don't want UI to update the cart when viewing it.
Some testing classes may have a dependency to the ServiceLocator, so the dependencies are injected via property, for example. That makes class more difficult to unit test. In this post I will present how to write unit test for a class with dependency to ServiceLocator, with the real world example of Optimizely.