@Test
public void getName() throws Exception {

    Logger loggerFromClass = new MiddlewareLoggerImpl(MiddlewareLoggerImplTest.class);
    Logger logger = new MiddlewareLoggerImpl(MiddlewareLoggerImplTest.class.getCanonicalName());
    Assert.assertEquals(loggerFromClass.getName(), logger.getName());
    String appName = "app";
    if (logger.isDebugEnabled()) {
        logger.debug("debug");
        logger.debug("debug {}", "1");
        logger.debug("debug {} {} {}", "1", "2", "3");
        logger.debug("debug", new RuntimeException("runtime"));
    }
    if (logger.isDebugEnabled(appName)) {
        logger.debugWithApp(appName, "debug");
        logger.debugWithApp(appName, "debug {}", "1");
        logger.debugWithApp(appName, "debug {} {} {}", "1", "2", "3");
        logger.debugWithApp(appName, "debug", new RuntimeException("runtime"));
    }
    if (logger.isInfoEnabled()) {
        logger.info("info");
        logger.info("info {}", "1");
        logger.info("info {} {} {}", "1", "2", "3");
        logger.info("info", new RuntimeException("runtime"));
    }
    if (logger.isInfoEnabled(appName)) {
        logger.infoWithApp(appName, "info");
        logger.infoWithApp(appName, "info {}", "1");
        logger.infoWithApp(appName, "info {} {} {}", "1", "2", "3");
        logger.infoWithApp(appName, "info", new RuntimeException("runtime"));
    }
    if (logger.isWarnEnabled()) {
        logger.warn("warn");
        logger.warn("warn {}", "1");
        logger.warn("warn {} {} {}", "1", "2", "3");
        logger.warn("warn", new RuntimeException("runtime"));
    }
    if (logger.isWarnEnabled(appName)) {
        logger.warn(appName, "warn");
        logger.warnWithApp(appName, "warn {}", "1");
        logger.warnWithApp(appName, "warn {} {} {}", "1", "2", "3");
        logger.warnWithApp(appName, "warn", new RuntimeException("runtime"));
    }
    if (logger.isErrorEnabled()) {
        logger.error("error");
        logger.error("error {}", "1");
        logger.error("error {} {} {}", "1", "2", "3");
        logger.error("error", new RuntimeException("runtime"));
    }
    if (logger.isErrorEnabled(appName)) {
        logger.errorWithApp(appName, "error");
        logger.errorWithApp(appName, "error {}", "1");
        logger.errorWithApp(appName, "error {} {} {}", "1", "2", "3");
        logger.errorWithApp(appName, "error", new RuntimeException("runtime"));
    }
}