package com.eactive.eai.common.sessioninfo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.test.context.ContextConfiguration;

import com.eactive.eai.data.CommonJPATestConfiguration;
import com.eactive.eai.data.jpa.BaseRepositoryImpl;

@DataJpaTest
@ContextConfiguration(classes = { CommonJPATestConfiguration.class })
@ComponentScan({ "com.eactive.eai.common.sessioninfo" })
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
		"com.eactive.eai.common.sessioninfo" })
@EntityScan({ "com.eactive.eai.data.entity.onl.sessioninfo" })
public class SessionInfoDAOTest {
	@Autowired
	SessionInfoDAO sessioninfoDAO;

//	@Test
//	@Transactional(propagation = Propagation.NOT_SUPPORTED)
//	void testStart() throws DAOException {
//		// given
//		String userId = "test001";
//		String sessionId = "session-001";
//		SessionInfoVO vo = new SessionInfoVO(userId);
//		vo.setSessionId(sessionId);
//		// when
//		sessioninfoDAO.upsertSessionInfo(vo);
//
//		vo.setSessionId("session-002");
//		sessioninfoDAO.upsertSessionInfo(vo);
//		// then
//		SessionInfoVO readVo = sessioninfoDAO.getSessionInfo(userId);
//		System.out.println("readVo ===>" + readVo.toString());
//		assertFalse(sessionId.equals(readVo.getSessionId()));
//	}
}
