@@ -0,0 +1,2290 @@
+package uk.ac.ebi.quickgo.ontology.controller;%0A%0Aimport uk.ac.ebi.quickgo.ontology.OntologyREST;%0A%0Aimport java.util.Arrays;%0Aimport java.util.stream.Collectors;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.test.context.TestPropertySource;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0Aimport org.springframework.test.web.servlet.MockMvc;%0Aimport org.springframework.test.web.servlet.ResultActions;%0Aimport org.springframework.test.web.servlet.setup.MockMvcBuilders;%0Aimport org.springframework.web.context.WebApplicationContext;%0A%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;%0A%0A/**%0A * @author Tony Wardell%0A * Date: 07/10/2016%0A * Time: 16:32%0A * Created with IntelliJ IDEA.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = %7BOntologyREST.class%7D)%0A@WebAppConfiguration%0A@TestPropertySource(properties = %7B%22coterm.source.manual=fu%22, %22coterm.source.all=bar%22%7D)%0Apublic class CoTermControllerFailedLoadIT %7B%0A%0A    private static final String RESOURCE_URL = %22/ontology/go/coterms%22;%0A    private static final String VALID_GO_TERM = %22GO:7777771%22;%0A%0A    @Autowired%0A    private WebApplicationContext webApplicationContext;%0A    private MockMvc mockMvc;%0A%0A    @Before%0A    public void setup() %7B%0A        mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext)%0A                .build();%0A    %7D%0A%0A    @Test%0A    public void internalServerErrorIfCoTermFilesNotLoaded() throws Exception %7B%0A        ResultActions response = mockMvc.perform(get(buildPathToResource(VALID_GO_TERM)));%0A        response.andDo(print())%0A                .andExpect(status().isInternalServerError());%0A    %7D%0A%0A    private String buildPathToResource(String id, String... args) %7B%0A        return RESOURCE_URL + %22/%22 + id + Arrays.stream(args)%0A                .collect(Collectors.joining(%22&%22, %22?%22, %22%22));%0A    %7D%0A%0A%7D%0A

Test calling findCoTerms if the data has not be loaded to the CoTerm repository.