package com.braintree.actions.consignment;

import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.orderprocessing.events.SendPickedUpMessageEvent;
import de.hybris.platform.ordersplitting.model.ConsignmentProcessModel;
import de.hybris.platform.servicelayer.event.EventService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;

@UnitTest
@RunWith(MockitoJUnitRunner.class)
public class BrainTreeSendPickedUpMessageActionTest {

    @Mock
    private EventService eventService;

    @InjectMocks
    private BrainTreeSendPickedUpMessageAction unit;

    @Mock
    private ConsignmentProcessModel process;

    @Test
    public void shouldPublishEvent() {
        //when
        unit.executeAction(process);

        //then
        verify(eventService).publishEvent(any(SendPickedUpMessageEvent.class));
    }

}
