generator.server.springboot.logging.logstash.test.LogstashTcpLifeCycleTest.mustache Maven / Gradle / Ivy
package {{packageName}}.wire.logstash.infrastructure.secondary;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static {{packageName}}.wire.logstash.infrastructure.secondary.LogstashTcpLifeCycle.ASYNC_LOGSTASH_APPENDER_NAME;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.pattern.ThrowableHandlingConverter;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import net.logstash.logback.appender.LogstashTcpSocketAppender;
import net.logstash.logback.stacktrace.ShortenedThrowableConverter;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.boot.test.json.ObjectContent;
import {{packageName}}.UnitTest;
@UnitTest
@JsonTest
class LogstashTcpLifeCycleTest {
@Autowired
private JacksonTester