/**
 *  Copyright 2005-2014 Red Hat, Inc.
 *
 *  Red Hat licenses this file to you 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 io.fabric8.jube.util;

import io.fabric8.utils.Strings;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 */
public class ImageMavenCoordsTest {

    private static Logger LOG = LoggerFactory.getLogger(ImageMavenCoordsTest.class);

    @Test
    public void testParseMavenCoordsUseDefaultPrefix() throws Exception {
        ImageMavenCoords coords = ImageMavenCoords.parse("fabric8/java", true);
        System.out.println("Parsed: " + coords);

        assertEquals("getGroupId()", "io.fabric8.jube.images.fabric8", coords.getGroupId());
        assertEquals("getArtifactId()", "java", coords.getArtifactId());
        assertTrue("Should have a valid version", Strings.isNotBlank(coords.getVersion()));
        assertEquals("getType()", "zip", coords.getType());
        assertEquals("getClassifier()", "image", coords.getClassifier());
    }

    @Test
    public void testParseMavenCoords() throws Exception {
        ImageMavenCoords coords = ImageMavenCoords.parse("fabric8/java");
        LOG.info("Parsed image maven coords: {}", coords);

        assertEquals("getGroupId()", "fabric8", coords.getGroupId());
        assertEquals("getArtifactId()", "java", coords.getArtifactId());
        assertTrue("Should have a valid version", Strings.isNotBlank(coords.getVersion()));
        assertEquals("getVersion", JubeVersionUtils.getReleaseVersion(), coords.getVersion());
        assertEquals("getType()", "zip", coords.getType());
        assertEquals("getClassifier()", "image", coords.getClassifier());
    }

}

@@ -1610,16 +1610,661 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testParseMavenCoordsVersion() throws Exception %7B%0A        ImageMavenCoords coords = ImageMavenCoords.parse(%22fabric8/java:-1.3%22);%0A        System.out.println(%22Parsed: %22 + coords);%0A%0A        assertEquals(%22getGroupId()%22, %22fabric8%22, coords.getGroupId());%0A        assertEquals(%22getArtifactId()%22, %22java%22, coords.getArtifactId());%0A        assertTrue(%22Should have a valid version%22, Strings.isNotBlank(coords.getVersion()));%0A        assertEquals(%22getType()%22, %22zip%22, coords.getType());%0A        assertEquals(%22getClassifier()%22, %22image%22, coords.getClassifier());%0A        assertEquals(%22getVersion%22, %22-1.3%22, coords.getVersion());%0A    %7D%0A%0A
     @Tes

Add maven coords parsing test