@Test public void initProducts() throws Exception { ProductRepository productRepository = new JdbcProductRepository("client1"); List<Product> products = productRepository.find(); List<DBObject> list = new ArrayList<>(); for (Product product : products) { list.add((DBObject) JSON.parse(Json.toJson(product).toString())); } dataBase.getCollection("demoProducts").insert(list); }
@Test public void testFind() throws Exception { repository.find(new ProductConditions()); repository.size(new ProductConditions()); }