0

I want to write the testcase to fetch the real path of this application-jars and procedd further. Can someone please help to write the testcase.

I am new to unit testing so not sure how to write test cases for servlets .

public void init(ServletConfig config) throws ServletException {
        try {
            Properties props = loadProperties();    
            info("Loaded properties: " + jnlpprops);

            String appsStr = checkAppsExists(props);
            supportedApps = Arrays.asList(appsStr.split(","));

            applicationjars = config.getServletContext().getRealPath("application-jars");
            if (applicationjars == null) {
                throw new ServletException("Cannot find path for application jars");
            }

            populateJarFileNames(applicationjars);

        } catch (ServletException e) {
            throw e;
        } finally {

        }
    }

0 Answers0