package eu.dnetlib.ariadneplus.virtuoso;

import freemarker.template.Configuration;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * Created by Alessia Bardi on 29/08/2017.
 * FIX ME: Mock freemarker configuration so the test can be run
 *
 * @author Alessia Bardi
 */
@Ignore
@RunWith(SpringRunner.class)
@WebMvcTest(VirtuosoReadAPI.class)
public class VirtuosoReadAPITest {
	@Autowired
	private MockMvc mvc;

	@MockBean
	private Configuration freemarkerConfig;


	@Test
	public void testGetSubject() throws Exception {
		mvc.perform(get("/virtuoso/subject").param("subjectURL", "xxx").param("timeout", "1234").param("typeName", "D14_Software")).andExpect(status().isOk());
	}

}
