// Path: plugins-compat-tester-model/src/main/java/org/jenkins/tools/test/model/MavenCoordinates.java
// public class MavenCoordinates implements Comparable<MavenCoordinates> {
//     public final String groupId;
//     public final String artifactId;
//     public final String version;
//     // No classifier/type for the moment...
// 
//     /**
//      * Constructor.
//      *
//      * @throws IllegalArgumentException one of the parameters is invalid.
//      */
//     public MavenCoordinates(@Nonnull String groupId, @Nonnull String artifactId, @Nonnull String version){
//         this.groupId = verifyInput( groupId, artifactId, version,"groupId", groupId);
//         this.artifactId = verifyInput( groupId, artifactId, version,"artifactId", artifactId);
//         this.version = verifyInput( groupId, artifactId, version,"version", version);
//     }
// 
//     private static String verifyInput(String groupId, String artifactId, String version,
//                                       String fieldName, String value) throws IllegalArgumentException {
//         if (value == null || StringUtils.isBlank(value)) {
//             throw new IllegalArgumentException(
//                     String.format("Invalid parameter passed for %s:%s:%s: Field %s; %s",
//                             groupId, artifactId, version, fieldName, value));
//         }
//         return value.trim();
//     }
// 
//     @Override
//     public boolean equals(Object o){
//         if (!(o instanceof MavenCoordinates)) {
//             return false;
//         }
//         MavenCoordinates c2 = (MavenCoordinates)o;
//         return new EqualsBuilder().append(groupId, c2.groupId).append(artifactId, c2.artifactId).append(version, c2.version).isEquals();
//     }
// 
//     @Override
//     public int hashCode(){
//         return new HashCodeBuilder().append(groupId).append(artifactId).append(version).toHashCode();
//     }
// 
//     @Override
//     public String toString(){
//         return "MavenCoordinates[groupId="+groupId+", artifactId="+artifactId+", version="+version+"]";
//     }
// 
//     public String toGAV(){
//         return groupId+":"+artifactId+":"+version;
//     }
// 
//     public static MavenCoordinates fromGAV(String gav){
//         String[] chunks = gav.split(":");
//         return new MavenCoordinates(chunks[0], chunks[1], chunks[2]);
//     }
// 
//     @Override
//     public int compareTo(MavenCoordinates o) {
//         if((groupId+":"+artifactId).equals(o.groupId+":"+o.artifactId)){
//             return compareVersionTo(o.version);
//         } else {
//             return (groupId+":"+artifactId).compareTo(o.groupId+":"+o.artifactId);
//         }
//     }
// 
//     public boolean matches(String groupId, String artifactId) {
//         return this.groupId.equals(groupId) && this.artifactId.equals(artifactId);
//     }
// 
//     public int compareVersionTo(String version) {
//         return new VersionComparator().compare(this.version, version);
//     }
// }
// 
// Path: plugins-compat-tester-model/src/main/java/org/jenkins/tools/test/model/PomData.java
// public class PomData {
//     public final String artifactId;
//     public final String groupId;
// 
//     @Nonnull
//     private final String packaging;
// 
//     @CheckForNull
//     public final MavenCoordinates parent;
//     private String connectionUrl;
//     private String scmTag;
//     private List<String> warningMessages = new ArrayList<>();
// 
//     public PomData(String artifactId, @CheckForNull String packaging, String connectionUrl, String scmTag, @CheckForNull MavenCoordinates parent, String groupId){
//         this.artifactId = artifactId;
//         this.groupId = groupId;
//         this.packaging = packaging != null ? packaging : "jar";
//         this.setConnectionUrl(connectionUrl);
//         this.scmTag = scmTag;
//         this.parent = parent;
//     }
// 
//     public String getConnectionUrl() {
//         return connectionUrl;
//     }
// 
//     public void setConnectionUrl(String connectionUrl) {
//         this.connectionUrl = connectionUrl;
//     }
// 
//     @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "Deliberately mutable")
//     public List<String> getWarningMessages() {
//         return warningMessages;
//     }
// 
//     @Nonnull
//     public String getPackaging() {
//         return packaging;
//     }
// 
//     public String getScmTag() {
//         return scmTag;
//     }
// 
//     public boolean isPluginPOM() {
//         if (parent != null) {
//             return parent.matches("org.jenkins-ci.plugins", "plugin");
//         } else { // Interpolate by packaging
//             return "hpi".equalsIgnoreCase(packaging);
//         }
//     }
// }


import com.google.common.collect.Lists;
import org.jenkins.tools.test.model.MavenCoordinates;
import org.jenkins.tools.test.model.PomData;
import org.junit.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
package org.jenkins.tools.test.hook;




public class WarningsNGExecutionHookTest {

    @Test
    public void testCheckMethod() {
        final WarningsNGExecutionHook hook = new WarningsNGExecutionHook();
        final MavenCoordinates parent = new MavenCoordinates("org.jenkins-ci.plugins", "plugin", "3.57");

        PomData pomData = new PomData("warnings-ng", "hpi", "it-does-not-matter", "whatever", parent, "org.jenkins-ci.plugins");
        Map<String, Object> info = new HashMap<>();
        info.put("pomData", pomData);
        assertTrue(hook.check(info));

        pomData = new PomData("other-plugin", "hpi", "it-does-not-matter", "whatever", parent, "org.jenkins-ci.plugins");
        info = new HashMap<>();
        info.put("pomData", pomData);
        assertFalse(hook.check(info));
    }

    @Test
    public void testAction() throws Exception {
// Path: plugins-compat-tester-model/src/main/java/org/jenkins/tools/test/model/MavenCoordinates.java
// public class MavenCoordinates implements Comparable<MavenCoordinates> {
//     public final String groupId;
//     public final String artifactId;
//     public final String version;
//     // No classifier/type for the moment...
// 
//     /**
//      * Constructor.
//      *
//      * @throws IllegalArgumentException one of the parameters is invalid.
//      */
//     public MavenCoordinates(@Nonnull String groupId, @Nonnull String artifactId, @Nonnull String version){
//         this.groupId = verifyInput( groupId, artifactId, version,"groupId", groupId);
//         this.artifactId = verifyInput( groupId, artifactId, version,"artifactId", artifactId);
//         this.version = verifyInput( groupId, artifactId, version,"version", version);
//     }
// 
//     private static String verifyInput(String groupId, String artifactId, String version,
//                                       String fieldName, String value) throws IllegalArgumentException {
//         if (value == null || StringUtils.isBlank(value)) {
//             throw new IllegalArgumentException(
//                     String.format("Invalid parameter passed for %s:%s:%s: Field %s; %s",
//                             groupId, artifactId, version, fieldName, value));
//         }
//         return value.trim();
//     }
// 
//     @Override
//     public boolean equals(Object o){
//         if (!(o instanceof MavenCoordinates)) {
//             return false;
//         }
//         MavenCoordinates c2 = (MavenCoordinates)o;
//         return new EqualsBuilder().append(groupId, c2.groupId).append(artifactId, c2.artifactId).append(version, c2.version).isEquals();
//     }
// 
//     @Override
//     public int hashCode(){
//         return new HashCodeBuilder().append(groupId).append(artifactId).append(version).toHashCode();
//     }
// 
//     @Override
//     public String toString(){
//         return "MavenCoordinates[groupId="+groupId+", artifactId="+artifactId+", version="+version+"]";
//     }
// 
//     public String toGAV(){
//         return groupId+":"+artifactId+":"+version;
//     }
// 
//     public static MavenCoordinates fromGAV(String gav){
//         String[] chunks = gav.split(":");
//         return new MavenCoordinates(chunks[0], chunks[1], chunks[2]);
//     }
// 
//     @Override
//     public int compareTo(MavenCoordinates o) {
//         if((groupId+":"+artifactId).equals(o.groupId+":"+o.artifactId)){
//             return compareVersionTo(o.version);
//         } else {
//             return (groupId+":"+artifactId).compareTo(o.groupId+":"+o.artifactId);
//         }
//     }
// 
//     public boolean matches(String groupId, String artifactId) {
//         return this.groupId.equals(groupId) && this.artifactId.equals(artifactId);
//     }
// 
//     public int compareVersionTo(String version) {
//         return new VersionComparator().compare(this.version, version);
//     }
// }
// 
// Path: plugins-compat-tester-model/src/main/java/org/jenkins/tools/test/model/PomData.java
// public class PomData {
//     public final String artifactId;
//     public final String groupId;
// 
//     @Nonnull
//     private final String packaging;
// 
//     @CheckForNull
//     public final MavenCoordinates parent;
//     private String connectionUrl;
//     private String scmTag;
//     private List<String> warningMessages = new ArrayList<>();
// 
//     public PomData(String artifactId, @CheckForNull String packaging, String connectionUrl, String scmTag, @CheckForNull MavenCoordinates parent, String groupId){
//         this.artifactId = artifactId;
//         this.groupId = groupId;
//         this.packaging = packaging != null ? packaging : "jar";
//         this.setConnectionUrl(connectionUrl);
//         this.scmTag = scmTag;
//         this.parent = parent;
//     }
// 
//     public String getConnectionUrl() {
//         return connectionUrl;
//     }
// 
//     public void setConnectionUrl(String connectionUrl) {
//         this.connectionUrl = connectionUrl;
//     }
// 
//     @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "Deliberately mutable")
//     public List<String> getWarningMessages() {
//         return warningMessages;
//     }
// 
//     @Nonnull
//     public String getPackaging() {
//         return packaging;
//     }
// 
//     public String getScmTag() {
//         return scmTag;
//     }
// 
//     public boolean isPluginPOM() {
//         if (parent != null) {
//             return parent.matches("org.jenkins-ci.plugins", "plugin");
//         } else { // Interpolate by packaging
//             return "hpi".equalsIgnoreCase(packaging);
//         }
//     }
// }


// Path: plugins-compat-tester/src/test/java/org/jenkins/tools/test/hook/WarningsNGExecutionHookTest.java
import com.google.common.collect.Lists;
import org.jenkins.tools.test.model.MavenCoordinates;
import org.jenkins.tools.test.model.PomData;
import org.junit.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

package org.jenkins.tools.test.hook;




public class WarningsNGExecutionHookTest {

    @Test
    public void testCheckMethod() {
        final WarningsNGExecutionHook hook = new WarningsNGExecutionHook();
        final MavenCoordinates parent = new MavenCoordinates("org.jenkins-ci.plugins", "plugin", "3.57");

        PomData pomData = new PomData("warnings-ng", "hpi", "it-does-not-matter", "whatever", parent, "org.jenkins-ci.plugins");
        Map<String, Object> info = new HashMap<>();
        info.put("pomData", pomData);
        assertTrue(hook.check(info));

        pomData = new PomData("other-plugin", "hpi", "it-does-not-matter", "whatever", parent, "org.jenkins-ci.plugins");
        info = new HashMap<>();
        info.put("pomData", pomData);
        assertFalse(hook.check(info));
    }

    @Test
    public void testAction() throws Exception {
        final WarningsNGExecutionHook hook = new WarningsNGExecutionHook();