package biz.paluch.logging.gelf.standalone;

import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import biz.paluch.logging.gelf.GelfMessageBuilder;
import biz.paluch.logging.gelf.GelfTestSender;
import biz.paluch.logging.gelf.intern.GelfMessage;
import biz.paluch.logging.gelf.intern.GelfSender;
import biz.paluch.logging.gelf.intern.GelfSenderFactory;

public class StandaloneGelfSenderTest {

    @Before
    public void before() throws Exception {
        GelfTestSender.getMessages().clear();
    }

    @Test
    public void testStandalone() throws Exception {
        DefaultGelfSenderConfiguration configuration = new DefaultGelfSenderConfiguration(new Slf4jErrorReporter());

        configuration.setHost("test:standalone");
        configuration.setPort(12345);

        GelfSender sender = GelfSenderFactory.createSender(configuration);

        sender.sendMessage(new GelfMessageBuilder().withFullMessage("message").withFacility(null).build());

        assertEquals(1, GelfTestSender.getMessages().size());

        GelfMessage gelfMessage = GelfTestSender.getMessages().get(0);
        assertEquals("message", gelfMessage.getFullMessage());
        assertEquals("{\"full_message\":\"message\"}", gelfMessage.toJson());

    }
}

@@ -56,62 +56,61 @@
 tic 
-org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Befor
+biz.paluch.logging.gelf.GelfMessageBuilder.newInstanc
 e;%0Ai
@@ -115,16 +115,23 @@
 %0Aimport 
+static 
 org.juni
@@ -136,64 +136,27 @@
 nit.
-Test;%0A%0Aimport biz.paluch.logging.gelf.GelfMessageBuilder
+Assert.assertEquals
 ;%0Aim
@@ -357,16 +357,64 @@
 Factory;
+%0Aimport org.junit.Before;%0Aimport org.junit.Test;
 %0A%0Apublic
@@ -936,27 +936,16 @@
 (new
- GelfMessageBuilder
+Instance
 ().w

Test fix