package com.prolog.upcloud.base.wh.operate.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext;
import com.prolog.framework.authority.util.HystrixVarUtil;
import com.prolog.upcloud.base.wh.operate.vo.MoveConfirmParamsVO;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@SpringBootTest
@RunWith(SpringRunner.class)
public class ReplenishServiceImplTest {

	@Resource
	private ReplenishServiceImpl service;

	@Before
	public void initUser() {
		HystrixRequestContext.initializeContext();
		HystrixVarUtil.setUserKey("qingniu-wms");
	}

	@Test
	public void autoConfirmReplenish() {

//		String msg = "[{\"billNo\":\"971166100173754368\",\"businessType\":\"INV_RTM\",\"containerNo\":\"800497\",\"employeeId\":\"0711\",\"isLack\":\"1\",\"itemId\":\"ssssslhyp001\",\"lackQty\":0.0,\"lotId\":\"971164421772677120\",\"msgId\":\"c466a069-d0b7-4baa-b484-10da7e789b7f\",\"ownerId\":\"748963439141064888\",\"packId\":\"ssssslhyp001\",\"taskId\":\"971166100173754368\",\"taskLineId\":\"971166100333137920\",\"warehouseId\":\"901884530611326976\",\"wmsLocationCode\":\"MJZ\",\"workType\":\"30\"}]";
		String msg = "{\"lineId\":\"975450650966102016\",\"moveFlag\":1,\"toWarehouseAreaCode\":\"AGVZ\"}";
		MoveConfirmParamsVO vo = JSONObject.parseObject(msg, MoveConfirmParamsVO.class);
		service.autoConfirmReplenish(vo);
	}
}