@@ -0,0 +1,2746 @@
+package uk.ac.ebi.quickgo.annotation.controller;%0A%0Aimport uk.ac.ebi.quickgo.annotation.AnnotationREST;%0Aimport uk.ac.ebi.quickgo.rest.metadata.MetaDataConfigProperties;%0A%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.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.context.annotation.Primary;%0Aimport org.springframework.core.io.FileSystemResource;%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 * Test the failure to load the metadata information.%0A *%0A * @author Tony Wardell%0A * Date: 09/03/2017%0A * Time: 13:53%0A * Created with IntelliJ IDEA.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = %7BAnnotationREST.class%7D)%0A@WebAppConfiguration%0Apublic class AnnotationControllerMetaDataSourceFailIT %7B%0A    private static final String RESOURCE_URL = %22/annotation%22;%0A    private MockMvc mockMvc;%0A%0A    @Autowired%0A    private WebApplicationContext webApplicationContext;%0A%0A    @Before%0A    public void setup() %7B%0A        mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();%0A%0A    %7D%0A%0A    // ------------------------------- Check about information -------------------------------%0A%0A    @Test%0A    public void about() throws Exception %7B%0A        ResultActions response = mockMvc.perform(get(RESOURCE_URL + %22/about%22));%0A%0A        response.andDo(print())%0A                .andExpect(status().isInternalServerError());%0A    %7D%0A%0A    /**%0A     * Configure properties used by co-term generation, using test values.%0A     */%0A    @Configuration%0A    public static class TestConfig %7B%0A        @Primary%0A        @Bean%0A        public MetaDataConfigProperties primaryMetaDataConfigProperties() %7B%0A            MetaDataConfigProperties properties = new MetaDataConfigProperties();%0A            FileSystemResource fileSystemResource = new FileSystemResource(%22/does/not/exist%22);%0A            properties.setSource(fileSystemResource);%0A            return properties;%0A        %7D%0A    %7D%0A%0A%7D%0A

Test the failure to load the source of metadata information for annotations.