// Path: src/test/java/de/siegmar/logbackgelf/GelfEncoderTest.java
// public static void basicValidation(final JsonNode jsonNode) {
//     coreValidation(jsonNode);
//     assertNotNull(jsonNode.get("_thread_name").textValue());
//     assertEquals(LOGGER_NAME, jsonNode.get("_logger_name").textValue());
// }
// 
// Path: src/test/java/de/siegmar/logbackgelf/GelfEncoderTest.java
// public static LoggingEvent simpleLoggingEvent(final Logger logger, final Throwable e) {
//     return new LoggingEvent(
//         LOGGER_NAME,
//         logger,
//         Level.DEBUG,
//         "message {}",
//         e,
//         new Object[]{1});
// }
// 
// Path: src/test/java/de/siegmar/logbackgelf/custom/CustomGelfEncoder.java
// public class CustomGelfEncoder extends GelfEncoder {
// 
//     @Override
//     protected byte[] gelfMessageToJson(final GelfMessage gelfMessage) {
//         final byte[] json = super.gelfMessageToJson(gelfMessage);
//         final String sha256 = Hashing.sha256().hashBytes(json).toString();
//         gelfMessage.getAdditionalFields().put("sha256", sha256);
//         return super.gelfMessageToJson(gelfMessage);
//     }
// 
// }


import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.LoggingEvent;
import de.siegmar.logbackgelf.custom.CustomGelfEncoder;
import static de.siegmar.logbackgelf.GelfEncoderTest.basicValidation;
import static de.siegmar.logbackgelf.GelfEncoderTest.simpleLoggingEvent;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.LoggerFactory;
/*
 * Logback GELF - zero dependencies Logback GELF appender library.
 * Copyright (C) 2016 Oliver Siegmar
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

package de.siegmar.logbackgelf;






public class CustomGelfEncoderTest {

    private static final String LOGGER_NAME = GelfEncoderTest.class.getCanonicalName();
    private static final String THREAD_NAME = "thread name";
    private static final long TIMESTAMP = 1577359700000L;

// Path: src/test/java/de/siegmar/logbackgelf/GelfEncoderTest.java
// public static void basicValidation(final JsonNode jsonNode) {
//     coreValidation(jsonNode);
//     assertNotNull(jsonNode.get("_thread_name").textValue());
//     assertEquals(LOGGER_NAME, jsonNode.get("_logger_name").textValue());
// }
// 
// Path: src/test/java/de/siegmar/logbackgelf/GelfEncoderTest.java
// public static LoggingEvent simpleLoggingEvent(final Logger logger, final Throwable e) {
//     return new LoggingEvent(
//         LOGGER_NAME,
//         logger,
//         Level.DEBUG,
//         "message {}",
//         e,
//         new Object[]{1});
// }
// 
// Path: src/test/java/de/siegmar/logbackgelf/custom/CustomGelfEncoder.java
// public class CustomGelfEncoder extends GelfEncoder {
// 
//     @Override
//     protected byte[] gelfMessageToJson(final GelfMessage gelfMessage) {
//         final byte[] json = super.gelfMessageToJson(gelfMessage);
//         final String sha256 = Hashing.sha256().hashBytes(json).toString();
//         gelfMessage.getAdditionalFields().put("sha256", sha256);
//         return super.gelfMessageToJson(gelfMessage);
//     }
// 
// }


// Path: src/test/java/de/siegmar/logbackgelf/CustomGelfEncoderTest.java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.LoggingEvent;
import de.siegmar.logbackgelf.custom.CustomGelfEncoder;
import static de.siegmar.logbackgelf.GelfEncoderTest.basicValidation;
import static de.siegmar.logbackgelf.GelfEncoderTest.simpleLoggingEvent;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.LoggerFactory;

/*
 * Logback GELF - zero dependencies Logback GELF appender library.
 * Copyright (C) 2016 Oliver Siegmar
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

package de.siegmar.logbackgelf;






public class CustomGelfEncoderTest {

    private static final String LOGGER_NAME = GelfEncoderTest.class.getCanonicalName();
    private static final String THREAD_NAME = "thread name";
    private static final long TIMESTAMP = 1577359700000L;

    private final CustomGelfEncoder encoder = new CustomGelfEncoder();