package com.braintree.converters.populators.configuration;

import com.braintree.hybris.data.BraintreeLocalPaymentsConfigurationData;
import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.core.model.BraintreeLocalPaymentsConfigurationModel;
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.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;

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

    @Mock
    private BraintreeLocalPaymentsConfigurationModel model;
    @InjectMocks
    private BraintreeLocalPaymentsConfigurationPopulator unit;

    @Test
    public void shouldPopulateLocalPaymentConfiguration() {
        BraintreeLocalPaymentsConfigurationData data = new BraintreeLocalPaymentsConfigurationData();
        when(model.isEnabled()).thenReturn(true);

        unit.populate(model, data);

        assertTrue(data.isEnabled());
    }
}