Add unit test for DiscoveryWriter