package com.membaza.api.users.config;

import com.mongodb.Mongo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author Emil Forslund
 * @since  1.0.0
 */
@Configuration
public class MongoConfig {

    @Autowired
    private Environment env;

    @Bean
    public MongoTemplate mongoTemplate(Mongo mongo) throws Exception {
        return new MongoTemplate(
            mongo, env.getProperty("spring.data.mongodb.database")
        );
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
@@ -36,34 +36,8 @@
 g;%0A%0A
-import com.mongodb.Mongo;%0A
 impo
@@ -95,16 +95,16 @@
 owired;%0A
+
 import o
@@ -261,68 +261,8 @@
 nt;%0A
-import org.springframework.data.mongodb.core.MongoTemplate;%0A
 impo
@@ -508,16 +508,16 @@
 towired%0A
+
     priv
@@ -542,208 +542,8 @@
 v;%0A%0A
-    @Bean%0A    public MongoTemplate mongoTemplate(Mongo mongo) throws Exception %7B%0A        return new MongoTemplate(%0A            mongo, env.getProperty(%22spring.data.mongodb.database%22)%0A        );%0A    %7D%0A%0A
     

Remove unnescessary template bean