@Bean
public MongoTemplate method1() throws Exception {
return new MongoTemplate(mongoDbConnection(), databaseName);
}` @Bean
public MongoClient method2() throws Exception {
uri = uri + "Example String";
ConnectionString connectionString = new ConnectionString(uri);
return MongoClients.create(connectionString);
}` how can I write the test cases for the above methods
If it is an object creation class that knows the expected value, you do not need to perform a test. If you must test, you only need to verify that the object is created and initialized properly.