Package com.github.kristofa.brave

Source Code of com.github.kristofa.brave.ServerTracerTest

package com.github.kristofa.brave;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;

import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class ServerTracerTest {

    @Test
    public void testServerTracer() {
        final AnnotationConfigApplicationContext ctx =
            new AnnotationConfigApplicationContext(TraceFiltersMockConfig.class, SpanCollectorMockConfig.class,
                ServerTracerConfig.class);
        try {
            final ServerTracer bean1 = ctx.getBean(ServerTracer.class);
            assertNotNull(bean1);
            final ServerTracer bean2 = ctx.getBean(ServerTracer.class);
            assertSame("Expect singleton.", bean1, bean2);

        } finally {
            ctx.close();
        }
    }

}
TOP

Related Classes of com.github.kristofa.brave.ServerTracerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.