Skip to content

Commit

Permalink
ProtocResolutionException tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ascopes committed Nov 7, 2023
1 parent 2a941d9 commit 7c0bd40
Showing 1 changed file with 44 additions and 0 deletions.
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();
}
}

0 comments on commit 7c0bd40

Please sign in to comment.