@Test
public void testSetModelData() {

    logger.debug("testSetModelData: enter");
    CreateOptimizationController controller = new CreateOptimizationController();
    HttpServletRequest request = createMock(HttpServletRequest.class);
    MockHttpServletResponse response = new MockHttpServletResponse();
    expect(request.getContentType())
            .andReturn("multipart/form-data; boundary=----WebKitFormBoundaryWcRUaIbC8kXgjr3p");
    expect(request.getMethod()).andReturn("post");
    expect(request.getHeader("Content-length")).andReturn("7809");
    expect(request.getContentLength()).andReturn(7809);
    try {
        // value of fileName needs to be matched to your local directory
        String fileName = "";
        try {
            ClassLoader classLoader = getClass().getClassLoader();
            fileName = new File(classLoader.getResource("schedulerPolicies-v1707.xmi").getFile()).getAbsolutePath();
        } catch (Exception e1) {
            logger.error("Exception Occured while loading file" + e1);
        }
        expect(request.getInputStream()).andReturn(new MockServletInputStream(fileName));
        expect(request.getCharacterEncoding()).andReturn("UTF-8");
        expect(request.getContentLength()).andReturn(1024);
        replay(request);
        controller.setModelData(request, response);
    } catch (Exception e) {
        logger.error("testSetModelData" + e);
        e.printStackTrace();
    }
    logger.debug("testSetModelData: exit");
}