package com.axelor.apps.supplychain;

import static org.junit.Assert.assertNotNull;

import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.axelor.app.AxelorModule;
import com.axelor.apps.base.db.repo.ProductRepository;
import com.axelor.apps.base.module.AdminModule;
import com.axelor.apps.base.module.BaseModule;
import com.axelor.apps.base.service.ProductService;
import com.axelor.apps.base.service.ProductServiceImpl;
import com.axelor.apps.base.service.user.UserService;
import com.axelor.apps.message.module.MessageModule;
import com.axelor.apps.stock.module.StockModule;
import com.axelor.apps.stock.service.StockMoveService;
import com.axelor.apps.supplychain.TestStockMove.MyModule;
import com.axelor.apps.tool.module.ToolModule;
import com.axelor.db.JPA;
import com.axelor.db.JpaModule;
import com.axelor.exception.AxelorException;
import com.axelor.inject.Beans;
import com.axelor.rpc.ObjectMapperProvider;
import com.axelor.test.GuiceModules;
import com.axelor.test.GuiceRunner;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
import com.axelor.apps.stock.db.StockMove;
import com.axelor.apps.stock.db.repo.StockMoveRepository;


@RunWith(GuiceRunner.class)
@GuiceModules({MyModule.class})
public class TestStockMove {

protected final Logger log = LoggerFactory.getLogger(getClass());


 static ProductRepository productRepository ;

 @Inject
 public StockMoveRepository stockMoveRepository;

  public static class MyModule extends AxelorModule {

    @Override
    protected void configure() {
      bind(ObjectMapper.class).toProvider(ObjectMapperProvider.class);
      install(new JpaModule("testUnit", true, true));
      bind(Beans.class).asEagerSingleton();
      install(new ToolModule());
      install(new MessageModule());
      install(new AdminModule());
      install(new BaseModule());
    }
  }

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
  }

  @Test
  public void testFunc() throws AxelorException {
    assertNotNull(productRepository.all().fetch().get(0));
  }


  

}   
