@@ -190,6 +190,7 @@ public void isExcluded() {
190
190
assertFalse (substringVersionConfig .isExcluded (null ));
191
191
}
192
192
193
+ @ Issue ("JENKINS-69135" ) //"Versions to include" feature for caching
193
194
@ Test
194
195
@ WithoutJenkins
195
196
public void isIncluded () {
@@ -205,6 +206,16 @@ public void isIncluded() {
205
206
assertTrue (substringVersionConfig .isIncluded (SUBSTRING_INCLUDED_VERSIONS_1 ));
206
207
assertTrue (substringVersionConfig .isIncluded (SUBSTRING_INCLUDED_VERSIONS_2 ));
207
208
209
+ assertFalse (nullVersionConfig .isIncluded ("" ));
210
+ assertFalse (oneVersionConfig .isIncluded ("" ));
211
+ assertFalse (multiVersionConfig .isIncluded ("" ));
212
+ assertFalse (substringVersionConfig .isIncluded ("" ));
213
+
214
+ assertFalse (nullVersionConfig .isIncluded (null ));
215
+ assertFalse (oneVersionConfig .isIncluded (null ));
216
+ assertFalse (multiVersionConfig .isIncluded (null ));
217
+ assertFalse (substringVersionConfig .isIncluded (null ));
218
+
208
219
}
209
220
210
221
@ Test
@@ -234,6 +245,9 @@ public void clearCache() throws Exception {
234
245
assertThat (new File (cache .withSuffix ("-name.txt" ).getRemote ()), not (anExistingFile ()));
235
246
}
236
247
248
+ //Test similar substrings in "Versions to include" & "Versions to exclude"
249
+ //Exclusion takes precedence
250
+ @ Issue ("JENKINS-69135" ) //"Versions to include" feature for caching
237
251
@ Test
238
252
public void clearCacheConflict () throws Exception {
239
253
sampleRepo .init ();
@@ -255,6 +269,7 @@ public void clearCacheConflict() throws Exception {
255
269
LibrariesAction action = b .getAction (LibrariesAction .class );
256
270
LibraryRecord record = action .getLibraries ().get (0 );
257
271
FilePath cache = LibraryCachingConfiguration .getGlobalLibrariesCacheDir ().child (record .getDirectoryName ());
272
+ // Cache should not get created since the version is included in "Versions to exclude"
258
273
assertThat (new File (cache .getRemote ()), not (anExistingDirectory ()));
259
274
assertThat (new File (cache .withSuffix ("-name.txt" ).getRemote ()), not (anExistingFile ()));
260
275
}
0 commit comments