Search in sources :

Example 16 with SimpleMongoClientDatabaseFactory

use of org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory in project SpringBoot-E-Commerce by kimyoungi99.

the class MongoDBCategoryDaoTest method init.

@BeforeEach
public void init() {
    this.categoryDao = new MongoDBCategoryDao(this.mongoTemplate);
    this.categoryEntity1 = CategoryEntity.builder().name("electronics").count(0L).build();
    this.wrongCategoryDao = new MongoDBCategoryDao(new MongoTemplate(new SimpleMongoClientDatabaseFactory("mongodb://localhost:9909/product")));
}
Also used : SimpleMongoClientDatabaseFactory(org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory) MongoTemplate(org.springframework.data.mongodb.core.MongoTemplate)

Aggregations

SimpleMongoClientDatabaseFactory (org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory)16 MongoTemplate (org.springframework.data.mongodb.core.MongoTemplate)13 Test (org.junit.jupiter.api.Test)4 BeforeAll (org.junit.jupiter.api.BeforeAll)3 MappingMongoConverter (org.springframework.data.mongodb.core.convert.MappingMongoConverter)3 Date (java.util.Date)2 lombok.val (lombok.val)2 MongoProperties (org.springframework.boot.autoconfigure.mongo.MongoProperties)2 MongoDatabaseFactory (org.springframework.data.mongodb.MongoDatabaseFactory)2 Flysql (com.isxcode.oxygen.flysql.core.Flysql)1 MongoException (com.mongodb.MongoException)1 WriteConcern (com.mongodb.WriteConcern)1 MongoClient (com.mongodb.client.MongoClient)1 MongoDatabase (com.mongodb.client.MongoDatabase)1 LocalDate (java.time.LocalDate)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Document (org.bson.Document)1 ObjectId (org.bson.types.ObjectId)1