// Path: src/main/java/net/technolords/micro/model/ResponseContext.java
// public class ResponseContext {
//     public static final String JSON_CONTENT_TYPE = "application/json";
//     public static final String XML_CONTENT_TYPE = "application/xml";
//     public static final String PLAIN_TEXT_CONTENT_TYPE = "text/plain";
//     public static final String HTML_CONTENT_TYPE = "text/html";
//     public static final String DEFAULT_CONTENT_TYPE = JSON_CONTENT_TYPE;
//     private String response;
//     private String errorCode;
//     private String contentType = DEFAULT_CONTENT_TYPE;
// 
//     public String getResponse() {
//         return response;
//     }
// 
//     public void setResponse(String response) {
//         this.response = response;
//     }
// 
//     public String getErrorCode() {
//         return errorCode;
//     }
// 
//     public void setErrorCode(String errorCode) {
//         this.errorCode = errorCode;
//     }
// 
//     public String getContentType() {
//         return contentType;
//     }
// 
//     public void setContentType(String contentType) {
//         this.contentType = contentType;
//     }
// }


import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import net.technolords.micro.model.ResponseContext;
            { "info", Level.INFO, "Log level changed to INFO" },
            { "debug", Level.DEBUG, "Log level changed to DEBUG" },
            { "off", Level.OFF, "Logging switched off" },
            { "oops", Level.INFO, "Log level changed to INFO" },
        };
    }

    /**
     * Auxiliary method to reset the log info, in case logging is actually required during development
     * of the test.
     */
    @BeforeMethod (groups = { GROUP_CHANGE_LEVEL })
    public void resetLogLevelToInfo() {
        LoggerConfig rootLogger = this.getRootLogger();
        rootLogger.setLevel(Level.INFO);
    }

    /**
     * This test asserts the new log level has been set as well as the expected message
     * to be returned is correct.
     *
     * @param newLevel
     *  The new log level.
     * @param expectedLevel
     *  The expected log level.
     * @param expectedMessage
     *  The expected message.
     */
    @Test (dataProvider = DATASET_FOR_CHANGING_LOG_LEVELS, groups = { GROUP_CHANGE_LEVEL} )
    public void testChangeLogLevels(final String newLevel, final Level expectedLevel, final String expectedMessage) {
// Path: src/main/java/net/technolords/micro/model/ResponseContext.java
// public class ResponseContext {
//     public static final String JSON_CONTENT_TYPE = "application/json";
//     public static final String XML_CONTENT_TYPE = "application/xml";
//     public static final String PLAIN_TEXT_CONTENT_TYPE = "text/plain";
//     public static final String HTML_CONTENT_TYPE = "text/html";
//     public static final String DEFAULT_CONTENT_TYPE = JSON_CONTENT_TYPE;
//     private String response;
//     private String errorCode;
//     private String contentType = DEFAULT_CONTENT_TYPE;
// 
//     public String getResponse() {
//         return response;
//     }
// 
//     public void setResponse(String response) {
//         this.response = response;
//     }
// 
//     public String getErrorCode() {
//         return errorCode;
//     }
// 
//     public void setErrorCode(String errorCode) {
//         this.errorCode = errorCode;
//     }
// 
//     public String getContentType() {
//         return contentType;
//     }
// 
//     public void setContentType(String contentType) {
//         this.contentType = contentType;
//     }
// }


// Path: src/test/java/net/technolords/micro/log/LogManagerTest.java
import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import net.technolords.micro.model.ResponseContext;

            { "info", Level.INFO, "Log level changed to INFO" },
            { "debug", Level.DEBUG, "Log level changed to DEBUG" },
            { "off", Level.OFF, "Logging switched off" },
            { "oops", Level.INFO, "Log level changed to INFO" },
        };
    }

    /**
     * Auxiliary method to reset the log info, in case logging is actually required during development
     * of the test.
     */
    @BeforeMethod (groups = { GROUP_CHANGE_LEVEL })
    public void resetLogLevelToInfo() {
        LoggerConfig rootLogger = this.getRootLogger();
        rootLogger.setLevel(Level.INFO);
    }

    /**
     * This test asserts the new log level has been set as well as the expected message
     * to be returned is correct.
     *
     * @param newLevel
     *  The new log level.
     * @param expectedLevel
     *  The expected log level.
     * @param expectedMessage
     *  The expected message.
     */
    @Test (dataProvider = DATASET_FOR_CHANGING_LOG_LEVELS, groups = { GROUP_CHANGE_LEVEL} )
    public void testChangeLogLevels(final String newLevel, final Level expectedLevel, final String expectedMessage) {
        ResponseContext responseContext = LogManager.changeLogLevel(newLevel);