blob: 3618fee019e8f3eed147fe57e44a0d85621cb0e1 (
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
26
27
28
29
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.hosted.plugin;
import org.junit.jupiter.api.Test;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.OptionalInt;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author mpolden
*/
class CompileVersionMojoTest {
@Test
public void allow_major() {
assertMajorVersion(OptionalInt.empty(), Paths.get("non-existent-deployment.xml"));
assertMajorVersion(OptionalInt.empty(), Paths.get("src/test/resources/deployment.xml"));
assertMajorVersion(OptionalInt.of(8), Paths.get("src/test/resources/deployment-with-major.xml"));
}
private void assertMajorVersion(OptionalInt expected, Path deploymentXml) {
OptionalInt allowMajor = CompileVersionMojo.majorVersion(deploymentXml);
assertEquals(expected, allowMajor);
}
}
|