Project

General

Profile

1
package eu.dnetlib.parthenos.virtuoso;
2

    
3
import freemarker.template.Configuration;
4
import org.junit.Ignore;
5
import org.junit.Test;
6
import org.junit.runner.RunWith;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
9
import org.springframework.boot.test.mock.mockito.MockBean;
10
import org.springframework.test.context.junit4.SpringRunner;
11
import org.springframework.test.web.servlet.MockMvc;
12

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

    
16
/**
17
 * Created by Alessia Bardi on 29/08/2017.
18
 * FIX ME: Mock freemarker configuration so the test can be run
19
 *
20
 * @author Alessia Bardi
21
 */
22
@Ignore
23
@RunWith(SpringRunner.class)
24
@WebMvcTest(VirtuosoReadAPI.class)
25
public class VirtuosoReadAPITest {
26
	@Autowired
27
	private MockMvc mvc;
28

    
29
	@MockBean
30
	private Configuration freemarkerConfig;
31

    
32

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

    
38
}
(5-5/6)