/*
 * Copyright 2006-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.consol.citrus.admin.converter.action;

import com.consol.citrus.actions.*;
import com.consol.citrus.admin.model.TestAction;
import com.consol.citrus.model.testcase.core.*;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/**
 * @author Christoph Deppisch
 */
public class TestActionConverterTest {

    @Test(dataProvider = "converterData")
    public void testConvert(TestActionConverter actionConverter, Object definition, com.consol.citrus.TestAction actionModel, String actionType) throws Exception {
        TestAction result = actionConverter.convert(definition);
        Assert.assertEquals(result.getType(), actionType);

        Object modelConversion = actionConverter.convertModel(actionModel);
        Assert.assertEquals(modelConversion.getClass(), definition.getClass());
    }

    @Test
    public void specialTest() throws Exception {
        SendDefinition definition = new SendDefinition();
        definition.setMessage(new SendDefinition.Message());
        definition.getMessage().setData("Hello");
        testConvert(new SendMessageActionConverter(), definition, new SendMessageAction(), "send");
    }

    @DataProvider
    public Object[][] converterData() {
        return new Object[][] {
                new Object[] {new SendMessageActionConverter(), new SendDefinition(), new SendMessageAction(), "send"},
                new Object[] {new ReceiveMessageActionConverter(), new ReceiveDefinition(), new ReceiveMessageAction(), "receive"},
                new Object[] {new EchoActionConverter(), new EchoDefinition(), new EchoAction(), "echo"},
                new Object[] {new SleepActionConverter(), new SleepDefinition(), new SleepAction(), "sleep"},
        };
    }
}
@@ -1481,343 +1481,8 @@
  %7D%0A%0A
-    @Test%0A    public void specialTest() throws Exception %7B%0A        SendDefinition definition = new SendDefinition();%0A        definition.setMessage(new SendDefinition.Message());%0A        definition.getMessage().setData(%22Hello%22);%0A        testConvert(new SendMessageActionConverter(), definition, new SendMessageAction(), %22send%22);%0A    %7D%0A%0A
     

Remove temporary test