Skip to content

Commit 5838dc9

Browse files
authored
Expected value comes first in JUnit (#108)
* Expected value comes first in JUnit
1 parent 8c7433c commit 5838dc9

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ public void testDeployIfClassifierIsSet(DeployFileMojo mojo) throws Exception {
164164
assertEquals("bin", classifier);
165165
String version = (String) getVariableValueFromObject(mojo, "version");
166166
String url = (String) getVariableValueFromObject(mojo, "url");
167-
168167
execute(mojo, request -> {
169168
assertNotNull(request);
170169
List<Artifact> artifacts = new ArrayList<>(request.getArtifacts());

src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ public void testLegacyAltDeploymentRepositoryWithLegacyLayout(DeployMojo mojo) t
199199
MojoException.class,
200200
() -> mojo.getDeploymentRepository(true),
201201
"Should throw: Invalid legacy syntax and layout for repository.");
202-
assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository.");
202+
assertEquals("Invalid legacy syntax and layout for repository.", e.getMessage());
203203
assertEquals(
204-
e.getLongMessage(),
205-
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::http://localhost\" instead, and only default layout is supported.");
204+
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::http://localhost\" instead, and only default layout is supported.",
205+
e.getLongMessage());
206206
}
207207

208208
@Test
@@ -215,10 +215,10 @@ public void testInsaneAltDeploymentRepository(DeployMojo mojo) throws IllegalAcc
215215
MojoException.class,
216216
() -> mojo.getDeploymentRepository(true),
217217
"Should throw: Invalid legacy syntax and layout for repository.");
218-
assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository.");
218+
assertEquals("Invalid legacy syntax and layout for repository.", e.getMessage());
219219
assertEquals(
220-
e.getLongMessage(),
221-
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::wow::foo::http://localhost\" instead, and only default layout is supported.");
220+
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::wow::foo::http://localhost\" instead, and only default layout is supported.",
221+
e.getLongMessage());
222222
}
223223

224224
@Test
@@ -242,10 +242,10 @@ public void testLegacyScmSvnAltDeploymentRepository(DeployMojo mojo) throws Ille
242242
MojoException.class,
243243
() -> mojo.getDeploymentRepository(true),
244244
"Should throw: Invalid legacy syntax and layout for repository.");
245-
assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository.");
245+
assertEquals("Invalid legacy syntax and layout for repository.", e.getMessage());
246246
assertEquals(
247-
e.getLongMessage(),
248-
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::scm:svn:http://localhost\" instead, and only default layout is supported.");
247+
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::scm:svn:http://localhost\" instead, and only default layout is supported.",
248+
e.getLongMessage());
249249
}
250250

251251
@Test

0 commit comments

Comments
 (0)