|
38 | 38 |
|
39 | 39 | import static org.apache.maven.api.plugin.testing.MojoExtension.setVariableValueToObject; |
40 | 40 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
| 41 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 42 | +import static org.junit.jupiter.api.Assertions.assertFalse; |
41 | 43 | import static org.junit.jupiter.api.Assertions.assertThrows; |
42 | 44 | import static org.junit.jupiter.api.Assertions.assertTrue; |
43 | 45 | import static org.mockito.ArgumentMatchers.contains; |
@@ -157,7 +159,7 @@ void typeParameterUsedForMatching() throws Exception { |
157 | 159 | mojo.execute(); |
158 | 160 |
|
159 | 161 | String result = new String(Files.readAllBytes(pomFile.toPath()), StandardCharsets.UTF_8); |
160 | | - assertTrue(!result.contains("test-jar"), "test-jar variant should be removed"); |
| 162 | + assertFalse(result.contains("test-jar"), "test-jar variant should be removed"); |
161 | 163 | assertTrue(result.contains("com.example"), "jar variant should remain"); |
162 | 164 | } |
163 | 165 |
|
@@ -205,7 +207,7 @@ void modelSyncPreservesOtherVariantsOnRemove() throws Exception { |
205 | 207 | mojo.execute(); |
206 | 208 |
|
207 | 209 | // In-memory model should still have the jar variant |
208 | | - assertTrue(model.getDependencies().size() == 1, "model should have 1 dependency remaining"); |
| 210 | + assertEquals(1, model.getDependencies().size(), "model should have 1 dependency remaining"); |
209 | 211 | assertTrue( |
210 | 212 | "jar".equals(model.getDependencies().get(0).getType()) |
211 | 213 | || model.getDependencies().get(0).getType() == null, |
@@ -275,7 +277,7 @@ void removeDependencyFromProfileSucceeds() throws Exception { |
275 | 277 | mojo.execute(); |
276 | 278 |
|
277 | 279 | String result = new String(Files.readAllBytes(pomFile.toPath()), StandardCharsets.UTF_8); |
278 | | - assertTrue(!result.contains("<groupId>com.example</groupId>"), "dependency should be removed"); |
| 280 | + assertFalse(result.contains("<groupId>com.example</groupId>"), "dependency should be removed"); |
279 | 281 | assertTrue(result.contains("<id>dev</id>"), "profile should remain"); |
280 | 282 | } |
281 | 283 |
|
@@ -328,7 +330,7 @@ void managedRemovalWithChildModulesWarnsAndProceeds() throws Exception { |
328 | 330 | assertDoesNotThrow(() -> mojo.execute()); |
329 | 331 |
|
330 | 332 | String result = new String(Files.readAllBytes(pomFile.toPath()), StandardCharsets.UTF_8); |
331 | | - assertTrue(!result.contains("<artifactId>lib</artifactId>"), "managed dep should be removed"); |
| 333 | + assertFalse(result.contains("<artifactId>lib</artifactId>"), "managed dep should be removed"); |
332 | 334 | } |
333 | 335 |
|
334 | 336 | @Test |
@@ -374,7 +376,7 @@ void managedRemovalWithChildModulePomPathWarnsAndProceeds() throws Exception { |
374 | 376 | assertDoesNotThrow(() -> mojo.execute()); |
375 | 377 |
|
376 | 378 | String result = new String(Files.readAllBytes(pomFile.toPath()), StandardCharsets.UTF_8); |
377 | | - assertTrue(!result.contains("<artifactId>lib</artifactId>"), "managed dep should be removed"); |
| 379 | + assertFalse(result.contains("<artifactId>lib</artifactId>"), "managed dep should be removed"); |
378 | 380 | verify(log).warn(contains("child-a/my-pom.xml")); |
379 | 381 | } |
380 | 382 |
|
|
0 commit comments