Search in sources :

Example 1 with TestJobEventConfiguration

use of com.dangdang.ddframe.job.event.fixture.TestJobEventConfiguration in project elastic-job by dangdangdotcom.

the class JobEventBusTest method assertPost.

@Test
public void assertPost() throws InterruptedException, NoSuchFieldException {
    jobEventBus = new JobEventBus(new TestJobEventConfiguration(jobEventCaller));
    assertIsRegistered(true);
    jobEventBus.post(new JobExecutionEvent("fake_task_id", "test_event_bus_job", ExecutionSource.NORMAL_TRIGGER, 0));
    while (!TestJobEventListener.isExecutionEventCalled()) {
        Thread.sleep(100L);
    }
    verify(jobEventCaller).call();
}
Also used : TestJobEventConfiguration(com.dangdang.ddframe.job.event.fixture.TestJobEventConfiguration) JobExecutionEvent(com.dangdang.ddframe.job.event.type.JobExecutionEvent) Test(org.junit.Test)

Aggregations

TestJobEventConfiguration (com.dangdang.ddframe.job.event.fixture.TestJobEventConfiguration)1 JobExecutionEvent (com.dangdang.ddframe.job.event.type.JobExecutionEvent)1 Test (org.junit.Test)1