Skip to content

Commit

Permalink
80: assertj assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Dec 31, 2019
1 parent 16bf7d4 commit 6f5fc06
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
6 changes: 6 additions & 0 deletions edelta.parent/edelta.maven.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
<version>1.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edelta.maven.plugin;

import static org.junit.Assert.assertFalse;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -62,8 +62,7 @@ public void testProjectWithSkip() throws Exception {
EdeltaMojo edeltaMojo = executeMojo(pomPath);

File outputDirectory = new File(rule.getVariableValueFromObject(edeltaMojo, "outputDirectory").toString());
assertNotNull(outputDirectory);
assertFalse(outputDirectory.exists());
assertThat(outputDirectory).doesNotExist();
}

@Test
Expand All @@ -72,12 +71,10 @@ public void testProjectWithoutSources() throws Exception {
EdeltaMojo edeltaMojo = executeMojo(pomPath);

File outputDirectory = new File(rule.getVariableValueFromObject(edeltaMojo, "outputDirectory").toString());
assertNotNull(outputDirectory);
assertFalse(outputDirectory.exists());
assertThat(outputDirectory).doesNotExist();

File xtextTmpDirectory = new File(rule.getVariableValueFromObject(edeltaMojo, "tmpClassDirectory").toString());
assertNotNull(xtextTmpDirectory);
assertTrue(xtextTmpDirectory.exists());
assertThat(xtextTmpDirectory).exists();
}

@Test
Expand All @@ -89,8 +86,8 @@ public void testProjectWithoutEcore() throws Exception {
new File(
pomPath.getAbsolutePath(),
rule.getVariableValueFromObject(edeltaMojo, "outputDirectory").toString());
assertNotNull(outputDirectory);
assertTrue(outputDirectory.exists());
assertThat(outputDirectory)
.isDirectoryContaining("glob:**com");
}

@Test
Expand All @@ -102,8 +99,8 @@ public void testProjectWithEcore() throws Exception {
new File(
pomPath.getAbsolutePath(),
rule.getVariableValueFromObject(edeltaMojo, "outputDirectory").toString());
assertNotNull(outputDirectory);
assertTrue(outputDirectory.exists());
assertThat(outputDirectory)
.isDirectoryContaining("glob:**com");
}

@Test
Expand All @@ -115,14 +112,13 @@ public void testProjectWithOutputDirectory() throws Exception {
new File(
pomPath.getAbsolutePath(),
"edelta-gen");
assertNotNull(defaultOutputDirectory);
assertFalse(defaultOutputDirectory.exists());
assertThat(defaultOutputDirectory).doesNotExist();
File outputDirectory =
new File(
pomPath.getAbsolutePath(),
"alt-gen");
assertNotNull(outputDirectory);
assertTrue(outputDirectory.exists());
assertThat(outputDirectory)
.isDirectoryContaining("glob:**com");
}

}

0 comments on commit 6f5fc06

Please sign in to comment.