Package com.github.kristofa.brave

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

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 ServerSpanThreadBinderConfigTest {

    @Test
    public void testThreadBinder() {
        final AnnotationConfigApplicationContext ctx =
            new AnnotationConfigApplicationContext(ServerSpanThreadBinderConfig.class);
        try {
            final ServerSpanThreadBinderConfig bean1 = ctx.getBean(ServerSpanThreadBinderConfig.class);
            assertNotNull(bean1);
            final ServerSpanThreadBinderConfig bean2 = ctx.getBean(ServerSpanThreadBinderConfig.class);
            assertSame("Expect singleton.", bean1, bean2);

        } finally {
            ctx.close();
        }
    }

}
TOP

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

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.