Browse files

[NEXUS-4949] Fix misleading asserts (expected/actual were reversed)

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
  • Loading branch information...
1 parent 77adfd8 commit eebf37f442576513d11b27f4dea6357d8cedcd36 @adreghiciu adreghiciu committed Nov 22, 2012
View
19 ...t/java/org/sonatype/nexus/integrationtests/nexus3615/Nexus3615ArtifactInfoSecurityIT.java
@@ -12,24 +12,23 @@
*/
package org.sonatype.nexus.integrationtests.nexus3615;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.is;
import static org.sonatype.nexus.integrationtests.AbstractPrivilegeTest.TEST_USER_NAME;
import static org.sonatype.nexus.integrationtests.AbstractPrivilegeTest.TEST_USER_PASSWORD;
import java.io.IOException;
-import org.hamcrest.MatcherAssert;
import org.restlet.data.MediaType;
import org.sonatype.nexus.integrationtests.TestContainer;
import org.sonatype.nexus.rest.model.ArtifactInfoResource;
import org.sonatype.nexus.test.utils.RoleMessageUtil;
import org.sonatype.nexus.test.utils.UserMessageUtil;
import org.sonatype.security.rest.model.RoleResource;
import org.sonatype.security.rest.model.UserResource;
-import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-
import com.thoughtworks.xstream.XStream;
public class Nexus3615ArtifactInfoSecurityIT
@@ -120,14 +119,14 @@ public void checkViewAccess()
ArtifactInfoResource info =
getSearchMessageUtil().getInfo( REPO_TEST_HARNESS_REPO, "nexus3615/artifact/1.0/artifact-1.0.jar" );
- Assert.assertEquals( REPO_TEST_HARNESS_REPO, info.getRepositoryId() );
- Assert.assertEquals( "/nexus3615/artifact/1.0/artifact-1.0.jar", info.getRepositoryPath() );
- Assert.assertEquals( "b354a0022914a48daf90b5b203f90077f6852c68", info.getSha1Hash() );
+ assertThat( info.getRepositoryId(), is( REPO_TEST_HARNESS_REPO ) );
+ assertThat( info.getRepositoryPath(), is( "/nexus3615/artifact/1.0/artifact-1.0.jar" ) );
+ assertThat( info.getSha1Hash(), is( "b354a0022914a48daf90b5b203f90077f6852c68" ) );
// view priv no longer controls search results, only read priv
- Assert.assertEquals( 3, info.getRepositories().size() );
- MatcherAssert.assertThat( getRepositoryId( info.getRepositories() ), hasItems( REPO_TEST_HARNESS_REPO ) );
- Assert.assertEquals( "application/java-archive", info.getMimeType() );
- Assert.assertEquals( 1364, info.getSize() );
+ assertThat( info.getRepositories().size(), is( 3 ) );
+ assertThat( getRepositoryId( info.getRepositories() ), hasItems( REPO_TEST_HARNESS_REPO ) );
+ assertThat( info.getMimeType(), is( "application/java-archive" ) );
+ assertThat( info.getSize(), is( 1364L ) );
}
}

0 comments on commit eebf37f

Please sign in to comment.