package hudson.plugins.emailext;

import org.jenkinsci.plugins.workflow.steps.StepConfigTester;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.WithPlugin;

import java.net.URL;

/**
 * Created by acearl on 9/15/2015.
 */
public class EmailExtStepTest {

    @Rule
    public JenkinsRule r = new JenkinsRule();

    @Test
    @WithPlugin("config-file-provider.hpi")
    public void configRoundTrip() throws Exception {
        EmailExtStep step1 = new EmailExtStep("subject", "body");
        step1.to = "mickeymouse@disney.com";
        step1.replyTo = "mickeymouse@disney.com";
        step1.mimeType = "text/html";

        EmailExtStep step2 = new StepConfigTester(r).configRoundTrip(step1);
        r.assertEqualDataBoundBeans(step1, step2);
    }
}

@@ -239,32 +239,8 @@
 %0D%0A%0D%0A
-import java.net.URL;%0D%0A%0D%0A
 /**%0D
@@ -571,13 +571,14 @@
 ep1.
-to = 
+setTo(
 %22mic
@@ -589,32 +589,33 @@
 ouse@disney.com%22
+)
 ;%0D%0A        step1
@@ -619,18 +619,19 @@
 ep1.
-r
+setR
 eplyTo
- = 
+(
 %22mic
@@ -650,16 +650,17 @@
 ney.com%22
+)
 ;%0D%0A     
@@ -672,19 +672,20 @@
 ep1.
-m
+setM
 imeType
- = 
+(
 %22tex
@@ -691,16 +691,17 @@
 xt/html%22
+)
 ;%0D%0A%0D%0A   

Fix test.