-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...st/java/io/github/ascopes/protobufmavenplugin/resolver/ProtocResolutionExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.github.ascopes.protobufmavenplugin.resolver; | ||
|
||
import static io.github.ascopes.protobufmavenplugin.fixture.RandomData.someString; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@DisplayName("ProtocResolutionException tests") | ||
class ProtocResolutionExceptionTest { | ||
|
||
@DisplayName("ProtocResolutionException can be constructed with a single message parameter") | ||
@Test | ||
void protocResolutionExceptionCanBeConstructedWithSingleMessageParameter() { | ||
// Given | ||
var message = someString(); | ||
|
||
// When | ||
var ex = new ProtocResolutionException(message); | ||
|
||
// Then | ||
assertThat(ex) | ||
.hasMessage(message) | ||
.hasNoCause() | ||
.hasNoSuppressedExceptions(); | ||
} | ||
|
||
@DisplayName("ProtocResolutionException can be constructed with a message and cause parameter") | ||
@Test | ||
void protocResolutionExceptionCanBeConstructedWithMessageAndCauseParameter() { | ||
// Given | ||
var message = someString(); | ||
var cause = new Throwable(someString()); | ||
|
||
// When | ||
var ex = new ProtocResolutionException(message, cause); | ||
|
||
// Then | ||
assertThat(ex) | ||
.hasMessage(message) | ||
.hasCause(cause) | ||
.hasNoSuppressedExceptions(); | ||
} | ||
} |