// Path: src/test/java/org/simplify4u/plugins/TestArtifactBuilder.java
// public static TestArtifactBuilder testArtifact() {
//     return new TestArtifactBuilder();
// }


import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.simplify4u.plugins.TestArtifactBuilder.testArtifact;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/*
 * Copyright 2020-2021 Slawomir Jaranowski
 *
 * 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 org.simplify4u.plugins.keysmap;



/**
 * @author Slawomir Jaranowski.
 */
public class ArtifactPatternTest {

    @DataProvider(name = "lists")
    public Object[][] artifactsList() {
        return new Object[][]{
                {"Test.Group:tesT:*", testArtifact().build(), true},
                {"test.group:test:*", testArtifact().version("1.0.0.M5").build(), true},
                {"test.group:test:*", testArtifact().version("0.0.0.M1").build(), true},
                {"test.group:test:3.0.0-M1", testArtifact().version("3.0.0-M1").build(), true},
                {"test.group:test:3.0.0-M1", testArtifact().version("3.0.0-m1").build(), true},
                {"test.group:test:1.1.1", testArtifact().build(), true},
                {"test.group:test:1.1.1", testArtifact().version("1.1.1-SNAPSHOT").build(), false},
                {"test.group:test:1.1.1-SNAPSHOT", testArtifact().version("1.1.1-SNAPSHOT").build(), true},
                {"test.group:test:jar:1.1.1", testArtifact().build(), true},
                {"test.group:test:pom:1.1.1", testArtifact().build(), false},
                {"test.group:test:[1.1,2.0)", testArtifact().build(), true},
                {"test.group:test:pom:[1.1,2.0)", testArtifact().build(), false},
                {"test.group:test:[1.1,2.0)", testArtifact().version("1.1.1-SNAPSHOT").build(),
                    // Expecting false once https://issues.apache.org/jira/browse/MNG-3092 is resolved
                    true},
                {"test.group:test:[1.1,2.0)", testArtifact().version("2.0").build(), false},
                {"test.group:test:1.1.1", testArtifact().version("1.1.2").build(), false},
                {"test.group:test:[1.1,1.1.1)", testArtifact().build(), false},
                {"test.group:test:[1.1,1.1.1)", testArtifact().version("1.1.1-SNAPSHOT").build(),
                    // Expecting false once https://issues.apache.org/jira/browse/MNG-3092 is resolved
                    true},
// Path: src/test/java/org/simplify4u/plugins/TestArtifactBuilder.java
// public static TestArtifactBuilder testArtifact() {
//     return new TestArtifactBuilder();
// }


// Path: src/test/java/org/simplify4u/plugins/keysmap/ArtifactPatternTest.java
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.simplify4u.plugins.TestArtifactBuilder.testArtifact;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/*
 * Copyright 2020-2021 Slawomir Jaranowski
 *
 * 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 org.simplify4u.plugins.keysmap;



/**
 * @author Slawomir Jaranowski.
 */
public class ArtifactPatternTest {

    @DataProvider(name = "lists")
    public Object[][] artifactsList() {
        return new Object[][]{
                {"Test.Group:tesT:*", testArtifact().build(), true},
                {"test.group:test:*", testArtifact().version("1.0.0.M5").build(), true},
                {"test.group:test:*", testArtifact().version("0.0.0.M1").build(), true},
                {"test.group:test:3.0.0-M1", testArtifact().version("3.0.0-M1").build(), true},
                {"test.group:test:3.0.0-M1", testArtifact().version("3.0.0-m1").build(), true},
                {"test.group:test:1.1.1", testArtifact().build(), true},
                {"test.group:test:1.1.1", testArtifact().version("1.1.1-SNAPSHOT").build(), false},
                {"test.group:test:1.1.1-SNAPSHOT", testArtifact().version("1.1.1-SNAPSHOT").build(), true},
                {"test.group:test:jar:1.1.1", testArtifact().build(), true},
                {"test.group:test:pom:1.1.1", testArtifact().build(), false},
                {"test.group:test:[1.1,2.0)", testArtifact().build(), true},
                {"test.group:test:pom:[1.1,2.0)", testArtifact().build(), false},
                {"test.group:test:[1.1,2.0)", testArtifact().version("1.1.1-SNAPSHOT").build(),
                    // Expecting false once https://issues.apache.org/jira/browse/MNG-3092 is resolved
                    true},
                {"test.group:test:[1.1,2.0)", testArtifact().version("2.0").build(), false},
                {"test.group:test:1.1.1", testArtifact().version("1.1.2").build(), false},
                {"test.group:test:[1.1,1.1.1)", testArtifact().build(), false},
                {"test.group:test:[1.1,1.1.1)", testArtifact().version("1.1.1-SNAPSHOT").build(),
                    // Expecting false once https://issues.apache.org/jira/browse/MNG-3092 is resolved
                    true},
                {"test.group:test:[1.1,1.1.1-SNAPSHOT)", testArtifact().build(), false},