/**
 * Copyright (c) 2011-2012 EBM WebSourcing, 2012-2024 Linagora
 * 
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or (at your
 * option) any later version.
 * 
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see http://www.gnu.org/licenses/
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.bc.mail;

import static org.junit.Assert.assertEquals;

import java.util.Map;

import org.junit.Test;
import org.ow2.petals.commons.log.TraceCode;
import org.ow2.petals.component.framework.logger.ConsumeExtFlowStepBeginLogDataTest;

/**
 * @author Olivier Fabre - EBM WebSourcing
 */
public class MailConsumeFlowStepBeginLogDataTest extends ConsumeExtFlowStepBeginLogDataTest {

    private static final String TEST_SCHEME = "scheme";

    private static final String TEST_HOST = "host";

    private static final String TEST_PORT = "port";

    private static final String TEST_USER = "user";

    private static final String TEST_FOLDER = "folder";

    @Override
    @Test
    public void testConstructor() {
        final TraceCode traceCode = TraceCode.CONSUME_EXT_FLOW_STEP_BEGIN;
        final MailConsumeFlowStepBeginLogData logData = new MailConsumeFlowStepBeginLogData(
                TEST_FLOW_INSTANCE_ID, TEST_FLOW_STEP_ID,
                TEST_SCHEME, TEST_HOST, TEST_PORT, TEST_USER, TEST_FOLDER);
        assertEquals(createExpectedLogData(traceCode), logData);
    }

    @Override
    protected Map<String, Object> createExpectedLogData(final TraceCode traceCode) {
        final Map<String, Object> expectedLogData = super.createExpectedLogData(traceCode);
        expectedLogData.put(MailConsumeFlowStepBeginLogData.SCHEME_KEY, TEST_SCHEME);
        expectedLogData.put(MailConsumeFlowStepBeginLogData.HOST_KEY, TEST_HOST);
        expectedLogData.put(MailConsumeFlowStepBeginLogData.PORT_KEY, TEST_PORT);
        expectedLogData.put(MailConsumeFlowStepBeginLogData.USER_KEY, TEST_USER);
        expectedLogData.put(MailConsumeFlowStepBeginLogData.FOLDER_KEY, TEST_FOLDER);
        return expectedLogData;
    }

}
