package fr.mmarie.core.jira;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

@Getter
@NoArgsConstructor
public class JiraConfiguration {
    @NotEmpty
    @NotNull
    @JsonProperty
    private String username;

    @NotEmpty
    @NotNull
    @JsonProperty
    private String password;

    @NotEmpty
    @NotNull
    @JsonProperty
    private String url;

    @NotEmpty
    @NotNull
    @JsonProperty
    private List<TransitionConfiguration> transitions;

    @VisibleForTesting
    public JiraConfiguration(String username,
                             String password,
                             String url,
                             List<TransitionConfiguration> transitions) {
        this.username = username;
        this.password = password;
        this.url = url;
        this.transitions = transitions;
    }
}

@@ -133,16 +133,56 @@
 esting;%0A
+import com.google.common.collect.Lists;%0A
 import l
@@ -653,30 +653,16 @@
 g url;%0A%0A
-    @NotEmpty%0A
     @Not
@@ -737,16 +737,39 @@
 nsitions
+ = Lists.newArrayList()
 ;%0A%0A    @

work without setting any transition