|
Here some tips to start:
For metadata_loader_test:
to unit test metadata loader we need to have a mock of CSRS catalog_manager. It can be done by deriving from ShardingTestFixture e.g.
class MetadataLoaderTest : public ShardingTestFixture {
|
protected:
|
void setUp() override {
|
ShardingTestFixture::setUp();
|
|
getMessagingPort()->setRemote(HostAndPort("FakeRemoteClient:34567"));
|
configTargeter()->setFindHostReturnValue(configHost);
|
}
|
const HostAndPort configHost{HostAndPort("ConfigHost:23456")};
|
|
};
|
and use network_test_env calls to set up the callbacks that will be returned by mock network to a catalog_manager
There are some examples in catalog_manager_replica_set_add_shard_test.cpp
|