From b141b830d748a5d6d6c89e8a543a1ae08f1b5927 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 14 Jan 2015 14:49:36 +1100 Subject: [PATCH] formatting --- .../rest/services/BrowseServiceTest.java | 65 ++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java index 9490cf6a6..8c5ac149b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java @@ -35,12 +35,12 @@ import org.junit.After; 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; @@ -64,7 +64,6 @@ public class BrowseServiceTest return map; } - @Test public void metadatagetthenadd() throws Exception @@ -120,9 +119,13 @@ public class BrowseServiceTest 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 @@ -133,9 +136,12 @@ public class BrowseServiceTest 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 ) ); } @@ -155,9 +161,14 @@ public class BrowseServiceTest 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 @@ -166,9 +177,9 @@ public class BrowseServiceTest { 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(); } @@ -185,8 +196,11 @@ public class BrowseServiceTest 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 @@ -201,8 +215,10 @@ public class BrowseServiceTest 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 @@ -259,7 +275,8 @@ public class BrowseServiceTest browseService.addMetadata( "commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID ); - List artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", TEST_REPO_ID ); + List artifactDownloadInfos = + browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", TEST_REPO_ID ); assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 3 ); // END SNIPPET: get-artifacts-by-project-version-metadata @@ -274,7 +291,8 @@ public class BrowseServiceTest browseService.addMetadata( "commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID ); - List artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", null ); + List artifactDownloadInfos = + browseService.getArtifactsByProjectVersionMetadata( "wine", "bordeaux", null ); assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 3 ); } @@ -287,7 +305,8 @@ public class BrowseServiceTest // START SNIPPET: get-artifacts-by-property BrowseService browseService = getBrowseService( authorizationHeader, true ); - List artifactDownloadInfos = browseService.getArtifactsByProperty( "org.name", "The Apache Software Foundation", TEST_REPO_ID ); + List artifactDownloadInfos = + browseService.getArtifactsByProperty( "org.name", "The Apache Software Foundation", TEST_REPO_ID ); assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 7 ); // END SNIPPET: get-artifacts-by-property @@ -301,7 +320,8 @@ public class BrowseServiceTest // START SNIPPET: search-artifacts BrowseService browseService = getBrowseService( authorizationHeader, true ); - List artifactDownloadInfos = browseService.searchArtifacts( "The Apache Software Foundation", TEST_REPO_ID, true ); + List artifactDownloadInfos = + browseService.searchArtifacts( "The Apache Software Foundation", TEST_REPO_ID, true ); assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 7 ); // END SNIPPET: search-artifacts @@ -315,7 +335,8 @@ public class BrowseServiceTest // START SNIPPET: search-artifacts-by-field BrowseService browseService = getBrowseService( authorizationHeader, true ); - List artifactDownloadInfos = browseService.searchArtifacts( "org.name", "The Apache Software Foundation", TEST_REPO_ID, true ); + List 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 -- 2.39.5