<commit_before>package com.atexpose.dispatcher.logging;

import com.atexpose.dispatcher.channels.TestChannel;
import com.atexpose.dispatcher.logging.format.JsonFormatter;
import com.atexpose.dispatcher.logging.writer.TestLogWriter;
import com.atexpose.dispatcher.parser.Request;
import io.schinzel.basicutils.EmptyObjects;
import io.schinzel.basicutils.crypto.cipher.ICipher;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.anyString;

/**
 * @author Schinzel
 */
public class LoggerTest {
    private static int THREAD_NO = 1234;
    TestLogWriter mLogWriter;
    Logger mLogger;
    TestChannel mChannel;
    LogEntry mLogEntry;


    @Before
    public void before() {
        ICipher mockCipher = Mockito.mock(ICipher.class);
        Mockito.when(mockCipher.encrypt(anyString())).thenReturn("EncryptedString");
        mLogWriter = new TestLogWriter();
        mLogger = Logger.builder()
                .loggerType(LoggerType.EVENT)
                .logFormatter(new JsonFormatter())
                .logWriter(mLogWriter)
                .cipher(mockCipher)
                .build();<commit_msg>Misc improvements<commit_after>package com.atexpose.dispatcher.logging;

import com.atexpose.dispatcher.channels.TestChannel;
import com.atexpose.dispatcher.logging.format.JsonFormatter;
import com.atexpose.dispatcher.logging.writer.TestLogWriter;
import com.atexpose.dispatcher.parser.Request;
import io.schinzel.basicutils.EmptyObjects;
import io.schinzel.basicutils.crypto.cipher.ICipher;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.anyString;

/**
 * @author Schinzel
 */
public class LoggerTest {
    private static int THREAD_NO = 1234;
    private TestLogWriter mLogWriter;
    private Logger mLogger;
    private TestChannel mChannel;
    private LogEntry mLogEntry;


    @Before
    public void before() {
        ICipher mockCipher = Mockito.mock(ICipher.class);
        Mockito.when(mockCipher.encrypt(anyString())).thenReturn("EncryptedString");
        mLogWriter = new TestLogWriter();
        mLogger = Logger.builder()
                .loggerType(LoggerType.EVENT)
                .logFormatter(new JsonFormatter())
                .logWriter(mLogWriter)
                .cipher(mockCipher)
                .build();
{'fraction_non_alphanumeric': 0.0981012658227848, 'fraction_numerical': 0.0031645569620253164, 'mean_word_length': 3.5160714285714287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2402800', 'n_tokens_mistral': 757, 'n_tokens_neox': 732, 'n_words': 134}