@Test
public void testImportBlackList() throws Exception {

    byte[] fileContent = FileCopyUtils
            .copyToByteArray(Thread.currentThread().getContextClassLoader().getResourceAsStream("BlackList.xls"));
    MockMultipartFile file = new MockMultipartFile("BlackList.xls",
            Thread.currentThread().getContextClassLoader().getResourceAsStream("BlackList.xls"));
    MockMultipartHttpServletRequest req = new MockMultipartHttpServletRequest();
    req.setMethod("POST");
    String boundary = "JPnJUN6FOo0qLySf-__r_RY1nQE7QOXXJ_nLK1s";
    req.setContentType("multipart/form-data; boundary=" + boundary);
    String start = "--" + boundary + "\r\n Content-Disposition: form-data; name=\"file\"; filename=\""
            + "BlackList.xls" + "\"\r\n" + "Content-type: " + "application/vnd.ms-excel" + "\r\n\r\n";
    String end = "\r\n--" + boundary + "--";
    req.setContent(ArrayUtils.addAll(start.getBytes(), ArrayUtils.addAll(fileContent, end.getBytes())));
    req.addHeader("name", "BlackList.xls");
    req.addFile(file);
    ExportAndImportDecisionBlackListEntries controller = new ExportAndImportDecisionBlackListEntries();
    MockHttpServletResponse resp = new MockHttpServletResponse();
    controller.importBlackListFile(req, resp);
    assertTrue(resp.getContentAsString().contains("data"));
}