Fix tests compilation in 201
This commit is contained in:
+8
-8
@@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.Manifest;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class ArtifactsTestUtil {
|
||||
public static String printToString(PackagingElement element, int level) {
|
||||
@@ -50,7 +50,7 @@ public class ArtifactsTestUtil {
|
||||
}
|
||||
|
||||
public static void assertLayout(PackagingElement element, String expected) {
|
||||
assertThat(printToString(element, 0)).isEqualTo(adjustMultiLine(expected));
|
||||
assertEquals(adjustMultiLine(expected), printToString(element, 0));
|
||||
}
|
||||
|
||||
private static String adjustMultiLine(String expected) {
|
||||
@@ -75,11 +75,11 @@ public class ArtifactsTestUtil {
|
||||
}
|
||||
|
||||
public static void assertOutputPath(Project project, String artifactName, String expected) {
|
||||
assertThat(findArtifact(project, artifactName).getOutputPath()).isEqualTo(expected);
|
||||
assertEquals(expected, findArtifact(project, artifactName).getOutputPath());
|
||||
}
|
||||
|
||||
public static void assertOutputFileName(Project project, String artifactName, String expected) {
|
||||
assertThat(findArtifact(project, artifactName).getRootElement().getName()).isEqualTo(expected);
|
||||
assertEquals(expected, findArtifact(project, artifactName).getRootElement().getName());
|
||||
}
|
||||
|
||||
public static void setOutput(final Project project, final String artifactName, final String outputPath) {
|
||||
@@ -102,7 +102,7 @@ public class ArtifactsTestUtil {
|
||||
public static Artifact findArtifact(Project project, String artifactName) {
|
||||
final ArtifactManager manager = ArtifactManager.getInstance(project);
|
||||
final Artifact artifact = manager.findArtifact(artifactName);
|
||||
assertThat(artifact).describedAs("'" + artifactName + "' artifact not found").isNotNull();
|
||||
assertNotNull("\"'\" + artifactName + \"' artifact not found\"", artifact);
|
||||
return artifact;
|
||||
}
|
||||
|
||||
@@ -117,10 +117,10 @@ public class ArtifactsTestUtil {
|
||||
ArtifactType type,
|
||||
@Nullable String mainClass, @Nullable String classpath) {
|
||||
final VirtualFile file = ManifestFileUtil.findManifestFile(rootElement, context, type);
|
||||
assertThat(file).isNotNull();
|
||||
assertNotNull(file);
|
||||
final Manifest manifest = ManifestFileUtil.readManifest(file);
|
||||
assertThat(manifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS)).isEqualTo(mainClass);
|
||||
assertThat(manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH)).isEqualTo(classpath);
|
||||
assertEquals(mainClass, manifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS));
|
||||
assertEquals(classpath, manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user