GH-754 - Rename EventPublication.isPublicationCompleted() to ….isCompleted().

This commit is contained in:
Oliver Drotbohm
2024-08-07 21:25:58 +02:00
parent 9c7537f378
commit 9a908ee275
3 changed files with 13 additions and 3 deletions

View File

@@ -76,9 +76,19 @@ public interface EventPublication {
/**
* Returns whether the publication of the event has completed.
*
* @return will never be {@literal null}.
* @deprecated since 1.3, use {@link #isCompleted()} instead.
*/
@Deprecated
default boolean isPublicationCompleted() {
return isCompleted();
}
/**
* Returns whether the publication of the event has completed.
*
* @since 1.3
*/
default boolean isCompleted() {
return getCompletionDate().isPresent();
}

View File

@@ -48,7 +48,7 @@ class TargetEventPublicationUnitTests {
var publication = TargetEventPublication.of(new Object(),
PublicationTargetIdentifier.of("foo"));
assertThat(publication.isPublicationCompleted()).isFalse();
assertThat(publication.isCompleted()).isFalse();
assertThat(publication.getCompletionDate()).isNotPresent();
}
}

View File

@@ -86,7 +86,7 @@ class JdbcEventPublicationRepositoryPerformance {
var candidate = publications.get(new Random().nextInt(number));
if (!candidate.isPublicationCompleted()) {
if (!candidate.isCompleted()) {
toComplete = candidate;
}