@Test
public void wrongReadPreferenceTest() {

    Map<String, String> properties = new HashMap<String, String>();
    properties.put(READ_PREFERENCE.getOptionName(), "falseReadPreference");
    ConnectorClusterConfig wrongConfig = new ConnectorClusterConfig(CLUSTER_NAME, null, properties);
    MongoClientConfiguration config = new MongoClientConfiguration(wrongConfig);
    try {
        config.getMongoClientOptions();
        fail("A exception must be thrown when no match any option");
    } catch (MongoValidationException e) {
    }
}