@Test public void testSearchByPropertyMapNotationWithMulipleValue() throws IOException { Map<String, List<String>> property = new HashMap<>(); property.put(colorsProp, asList("black", "white", "pink")); property.put(buildProp, asList("29")); List<RepoPath> list = artifactory.searches().itemsByProperty().properties(property).doSearch(); assertTrue(list.isEmpty()); }
@Test public void testSearchByPropertyWithMapNotation() throws IOException { Map<String, Boolean> properties = new HashMap<>(); properties.put(releasedProp, true); List<RepoPath> results = artifactory.searches().itemsByProperty().properties(properties).doSearch(); assertEquals(results.size(), 1); assertTrue(results.get(0).getItemPath().contains(artifactId + "-1.0.0-zip.jar")); }
@Test public void testSearchByProperty() throws IOException { List<RepoPath> results = artifactory.searches().itemsByProperty().property(colorsProp, "red").doSearch(); assertEquals(results.size(), 1); assertTrue(results.get(0).getItemPath().contains(artifactId + "-1.0.0-zip.jar")); }
@Test public void testSearchByPropertyWithWildCards() throws IOException { List<RepoPath> results = artifactory.searches().itemsByProperty().property(colorsProp, "r*?").doSearch(); assertEquals(results.size(), 1); assertTrue(results.get(0).getItemPath().contains(artifactId + "-1.0.0-zip.jar")); }
@Test public void testSearchByPropertyWithMulipleValue() throws IOException { List<RepoPath> list = artifactory.searches().itemsByProperty().property(colorsProp, "red", "green", "blue").doSearch(); assertTrue(list.isEmpty()); }
@Test public void testSearchByPropertyWithoutValue() throws IOException { List<RepoPath> results = artifactory.searches().itemsByProperty().property(releasedProp).property(buildProp, 28).doSearch(); assertEquals(results.size(), 1); assertTrue(results.get(0).getItemPath().contains(artifactId + "-1.0.0-zip.jar")); }
@Test public void testSearchByPropertyAndRepoFilter() throws IOException { List<RepoPath> results = artifactory.searches().itemsByProperty().property(releasedProp, true).repositories(localRepository.getKey()).doSearch(); assertEquals(results.size(), 1); assertTrue(results.get(0).getItemPath().contains(artifactId + "-1.0.0-zip.jar")); }
@Test public void testSearchByPropertyAndWrongRepoFilter() throws IOException { List<RepoPath> list = artifactory.searches().repositories(getJCenterRepoName()).itemsByProperty().property(releasedProp, true).doSearch(); assertTrue(list.isEmpty()); }