aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/test/java/com/yahoo/jdisc/application/BsnVersionTest.java
blob: eb3deb69ae2b0b28cdaaccf85a450637b14ca056 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.application;

import org.junit.jupiter.api.Test;
import org.osgi.framework.Version;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * @author gjoranv
 */
public class BsnVersionTest {

    @Test
    void readable_string_can_be_retrieved() {
        BsnVersion bsnVersion = new BsnVersion("com.yahoo.foo", new Version("1.0.0"));
        assertEquals("com.yahoo.foo version:1.0.0", bsnVersion.toReadableString());
    }

    @Test
    void version_qualifier_can_be_retrieved() {
        BsnVersion bsnVersion = new BsnVersion("foo", new Version(1, 2, 3, "SNAPSHOT"));
        assertEquals("SNAPSHOT", bsnVersion.version().getQualifier());
    }
}