1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.shared.release.policies;
20
21 import org.apache.maven.shared.release.policy.naming.NamingPolicyRequest;
22 import org.junit.Test;
23
24 import static org.junit.Assert.assertEquals;
25
26 public class DefaultNamingPolicyTest {
27 private final DefaultNamingPolicy policy = new DefaultNamingPolicy();
28
29 @Test
30 public void testName() throws Exception {
31 assertEquals(
32 "ARTIFACTID-VERSION",
33 policy.getName(newNamingPolicyRequest("ARTIFACTID", "VERSION")).getName());
34 assertEquals(
35 "ARTIFACTID-1.0-SNAPSHOT",
36 policy.getName(newNamingPolicyRequest("ARTIFACTID", "1.0-SNAPSHOT"))
37 .getName());
38 }
39
40 private NamingPolicyRequest newNamingPolicyRequest(String artifactId, String version) {
41 return new NamingPolicyRequest().setArtifactId(artifactId).setVersion(version);
42 }
43 }