1- package com .iexec .worker .utils .version ;
1+ /*
2+ * Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .iexec .worker .version ;
218
319import org .junit .jupiter .api .Assertions ;
420import org .junit .jupiter .api .BeforeEach ;
5- import org .junit .jupiter .api .Test ;
621import org .junit .jupiter .params .ParameterizedTest ;
722import org .junit .jupiter .params .provider .ValueSource ;
823import org .mockito .InjectMocks ;
@@ -25,18 +40,10 @@ public void preflight() {
2540 }
2641
2742 @ ParameterizedTest
28- @ ValueSource (strings ={"x.y.z" , "x.y.z-rc" })
29- void testNonSnapshotVersion (String version ) {
43+ @ ValueSource (strings ={"x.y.z" , "x.y.z-rc" , "x.y.z-NEXT-SNAPSHOT" })
44+ void testVersions (String version ) {
3045 Mockito .when (buildProperties .getVersion ()).thenReturn (version );
3146 Assertions .assertEquals (version , versionService .getVersion ());
32- Assertions .assertFalse (versionService .isSnapshot ());
33- }
34-
35- @ Test
36- void testSnapshotVersion () {
37- Mockito .when (buildProperties .getVersion ()).thenReturn ("x.y.z-NEXT-SNAPSHOT" );
38- Assertions .assertEquals ("x.y.z-NEXT-SNAPSHOT" , versionService .getVersion ());
39- Assertions .assertTrue (versionService .isSnapshot ());
4047 }
4148
4249}
0 commit comments