@@ -190,6 +190,7 @@ public void isExcluded() {
190190 assertFalse (substringVersionConfig .isExcluded (null ));
191191 }
192192
193+ @ Issue ("JENKINS-69135" ) //"Versions to include" feature for caching
193194 @ Test
194195 @ WithoutJenkins
195196 public void isIncluded () {
@@ -205,6 +206,16 @@ public void isIncluded() {
205206 assertTrue (substringVersionConfig .isIncluded (SUBSTRING_INCLUDED_VERSIONS_1 ));
206207 assertTrue (substringVersionConfig .isIncluded (SUBSTRING_INCLUDED_VERSIONS_2 ));
207208
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+
208219 }
209220
210221 @ Test
@@ -234,6 +245,9 @@ public void clearCache() throws Exception {
234245 assertThat (new File (cache .withSuffix ("-name.txt" ).getRemote ()), not (anExistingFile ()));
235246 }
236247
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
237251 @ Test
238252 public void clearCacheConflict () throws Exception {
239253 sampleRepo .init ();
@@ -255,6 +269,7 @@ public void clearCacheConflict() throws Exception {
255269 LibrariesAction action = b .getAction (LibrariesAction .class );
256270 LibraryRecord record = action .getLibraries ().get (0 );
257271 FilePath cache = LibraryCachingConfiguration .getGlobalLibrariesCacheDir ().child (record .getDirectoryName ());
272+ // Cache should not get created since the version is included in "Versions to exclude"
258273 assertThat (new File (cache .getRemote ()), not (anExistingDirectory ()));
259274 assertThat (new File (cache .withSuffix ("-name.txt" ).getRemote ()), not (anExistingFile ()));
260275 }
0 commit comments