Search in sources :

Example 1 with ChecksumSearch

use of org.apache.archiva.rest.api.model.ChecksumSearch in project archiva by apache.

the class SearchServiceTest method search_with_sha1.

/**
 * sha1 commons-logging 1.1 ba24d5de831911b684c92cd289ed5ff826271824
 */
@Test
public void search_with_sha1() throws Exception {
    SearchService searchService = getSearchService(authorizationHeader);
    List<Artifact> artifacts = searchService.getArtifactByChecksum(new ChecksumSearch(null, "ba24d5de831911b684c92cd289ed5ff826271824"));
    Assertions.assertThat(artifacts).isNotNull().isNotEmpty().hasSize(1);
}
Also used : ChecksumSearch(org.apache.archiva.rest.api.model.ChecksumSearch) SearchService(org.apache.archiva.rest.api.services.SearchService) Artifact(org.apache.archiva.maven2.model.Artifact) Test(org.junit.Test)

Example 2 with ChecksumSearch

use of org.apache.archiva.rest.api.model.ChecksumSearch in project archiva by apache.

the class SearchServiceTest method search_with_md5.

/**
 * md5 commons-logging 1.1 6b62417e77b000a87de66ee3935edbf5
 */
@Test
public void search_with_md5() throws Exception {
    SearchService searchService = getSearchService(authorizationHeader);
    List<Artifact> artifacts = searchService.getArtifactByChecksum(new ChecksumSearch(null, "6b62417e77b000a87de66ee3935edbf5"));
    Assertions.assertThat(artifacts).isNotNull().isNotEmpty().hasSize(1);
}
Also used : ChecksumSearch(org.apache.archiva.rest.api.model.ChecksumSearch) SearchService(org.apache.archiva.rest.api.services.SearchService) Artifact(org.apache.archiva.maven2.model.Artifact) Test(org.junit.Test)

Aggregations

Artifact (org.apache.archiva.maven2.model.Artifact)2 ChecksumSearch (org.apache.archiva.rest.api.model.ChecksumSearch)2 SearchService (org.apache.archiva.rest.api.services.SearchService)2 Test (org.junit.Test)2