package com.elab.spring.utils;

import com.elab.spring.config.ThreadConfiguration;
import com.elab.spring.utils.event.EventA;
import com.elab.spring.utils.event.EventB;
import com.elab.spring.utils.event.SourceModel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {SpringEventUtils.class, Source3ApplicationListener.class, Source2ApplicationListener.class,
    ThreadConfiguration.class, SourceApplicationListener.class})
public class SpringEventUtilsTest {

    @Test
    public void testSyncEventPublisher() {
        SourceModel sourceModel = new SourceModel();
        sourceModel.setName("abc");
        SpringEventUtils.syncEventPublisher(new EventA(sourceModel));

//        sourceModel.setName("BBBBBBBBBBBBBB");
//        SpringEventUtils.syncEventPublisher(new EventB(sourceModel));
    }

    public void testAsyncEventPublisher() {

    }
}