import org.junit.Before;
import org.junit.Test;
+import javax.ws.rs.core.MediaType;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.ws.rs.core.MediaType;
import static org.assertj.core.api.Assertions.assertThat;
return map;
}
-
@Test
public void metadatagetthenadd()
throws Exception
BrowseResult browseResult = browseService.getRootGroups( TEST_REPO_ID );
assertThat( browseResult ).isNotNull();
- assertThat( browseResult.getBrowseResultEntries() ).isNotNull().isNotEmpty().hasSize( 3 ).contains(
- new BrowseResultEntry( "commons-cli", false ), new BrowseResultEntry( "commons-logging", false ),
- new BrowseResultEntry( "org.apache", false ) );
+ assertThat( browseResult.getBrowseResultEntries() ) //
+ .isNotNull() //
+ .isNotEmpty() //
+ .hasSize( 3 ) //
+ .contains( new BrowseResultEntry( "commons-cli", false ), //
+ new BrowseResultEntry( "commons-logging", false ), //
+ new BrowseResultEntry( "org.apache", false ) );
}
@Test
BrowseResult browseResult = browseService.browseGroupId( "org.apache", TEST_REPO_ID );
assertThat( browseResult ).isNotNull();
- assertThat( browseResult.getBrowseResultEntries() ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
- new BrowseResultEntry( "org.apache.felix", false ),
- new BrowseResultEntry( "org.apache.karaf.features", false ) );
+ assertThat( browseResult.getBrowseResultEntries() ) //
+ .isNotNull() //
+ .isNotEmpty() //
+ .hasSize( 2 ) //
+ .contains( new BrowseResultEntry( "org.apache.felix", false ), //
+ new BrowseResultEntry( "org.apache.karaf.features", false ) );
}
BrowseService browseService = getBrowseService( authorizationHeader, false );
VersionsList versions =
- browseService.getVersionsList( "org.apache.karaf.features", "org.apache.karaf.features.core", TEST_REPO_ID );
+ browseService.getVersionsList( "org.apache.karaf.features", "org.apache.karaf.features.core",
+ TEST_REPO_ID );
assertThat( versions ).isNotNull();
- assertThat( versions.getVersions() ).isNotNull().isNotEmpty().hasSize( 2 ).contains( "2.2.1", "2.2.2" );
+ assertThat( versions.getVersions() ) //
+ .isNotNull() //
+ .isNotEmpty() //
+ .hasSize( 2 ) //
+ .contains( "2.2.1", "2.2.2" );
}
@Test
{
BrowseService browseService = getBrowseService( authorizationHeader, true );
- ProjectVersionMetadata metadata = browseService.getProjectVersionMetadata( "org.apache.karaf.features",
- "org.apache.karaf.features.core",
- TEST_REPO_ID );
+ ProjectVersionMetadata metadata =
+ browseService.getProjectVersionMetadata( "org.apache.karaf.features", "org.apache.karaf.features.core",
+ TEST_REPO_ID );
assertThat( metadata ).isNotNull();
}
log.info( "artifactContentEntries: {}", artifactContentEntries );
- assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 2 ).contains( new ArtifactContentEntry(
- "org", false, 0, TEST_REPO_ID ), new ArtifactContentEntry( "META-INF", false, 0, TEST_REPO_ID ) );
+ assertThat( artifactContentEntries ).isNotNull() //
+ .isNotEmpty() //
+ .hasSize( 2 ) //
+ .contains( new ArtifactContentEntry( "org", false, 0, TEST_REPO_ID ), //
+ new ArtifactContentEntry( "META-INF", false, 0, TEST_REPO_ID ) );
}
@Test
log.info( "artifactContentEntries: {}", artifactContentEntries );
- assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 1 ).contains(
- new ArtifactContentEntry( "org/apache", false, 1, TEST_REPO_ID ) );
+ assertThat( artifactContentEntries ).isNotNull() //
+ .isNotEmpty() //
+ .hasSize( 1 ) //
+ .contains( new ArtifactContentEntry( "org/apache", false, 1, TEST_REPO_ID ) );
}
@Test
browseService.addMetadata( "commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID );
- List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", TEST_REPO_ID );
+ List<Artifact> artifactDownloadInfos =
+ browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", TEST_REPO_ID );
assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 3 );
// END SNIPPET: get-artifacts-by-project-version-metadata
browseService.addMetadata( "commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID );
- List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", null );
+ List<Artifact> artifactDownloadInfos =
+ browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", null );
assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 3 );
}
// START SNIPPET: get-artifacts-by-property
BrowseService browseService = getBrowseService( authorizationHeader, true );
- List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProperty( "org.name", "The Apache Software Foundation", TEST_REPO_ID );
+ List<Artifact> artifactDownloadInfos =
+ browseService.getArtifactsByProperty( "org.name", "The Apache Software Foundation", TEST_REPO_ID );
assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 7 );
// END SNIPPET: get-artifacts-by-property
// START SNIPPET: search-artifacts
BrowseService browseService = getBrowseService( authorizationHeader, true );
- List<Artifact> artifactDownloadInfos = browseService.searchArtifacts( "The Apache Software Foundation", TEST_REPO_ID, true );
+ List<Artifact> artifactDownloadInfos =
+ browseService.searchArtifacts( "The Apache Software Foundation", TEST_REPO_ID, true );
assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 7 );
// END SNIPPET: search-artifacts
// START SNIPPET: search-artifacts-by-field
BrowseService browseService = getBrowseService( authorizationHeader, true );
- List<Artifact> artifactDownloadInfos = browseService.searchArtifacts( "org.name", "The Apache Software Foundation", TEST_REPO_ID, true );
+ List<Artifact> artifactDownloadInfos =
+ browseService.searchArtifacts( "org.name", "The Apache Software Foundation", TEST_REPO_ID, true );
assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 7 );
// END SNIPPET: search-artifacts-by-field