Skip to content

Commit b2b70a1

Browse files
committed
Small testing additions
1 parent dc4df35 commit b2b70a1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

validator/api/src/test/java/tech/pegasys/teku/validator/api/GraffitiManagerTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ void deleteGraffiti_shouldReturnErrorMessageWhenUnableToDeleteFile(@TempDir fina
141141
assertThat(file.getParentFile().setWritable(false)).isTrue();
142142

143143
assertThatThrownBy(() -> manager.deleteGraffiti(publicKey))
144-
.isInstanceOf(GraffitiManagementException.class);
144+
.isInstanceOf(GraffitiManagementException.class)
145+
.hasMessage("Unable to delete graffiti for validator " + publicKey);
145146
assertThat(file.exists()).isTrue();
146147
}
147148

validator/api/src/test/java/tech/pegasys/teku/validator/api/UpdatableGraffitiProviderTest.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,29 @@ public void get_shouldDelegateToDefaultProviderWhenStorageProviderFails() throws
7070
}
7171

7272
@Test
73-
void getWithThrowable_shouldGetStorageGraffitiWhenAvailable() {
73+
void getWithThrowable_shouldGetStorageGraffitiWhenAvailable() throws Throwable {
7474
provider = new UpdatableGraffitiProvider(() -> Optional.of(storageGraffiti), Optional::empty);
75-
assertThat(provider.get()).hasValue(storageGraffiti);
75+
assertThat(provider.getWithThrowable()).hasValue(storageGraffiti);
7676
}
7777

7878
@Test
79-
void getWithThrowable_shouldGetStorageGraffitiWhenBothAvailable() {
79+
void getWithThrowable_shouldGetStorageGraffitiWhenBothAvailable() throws Throwable {
8080
provider =
8181
new UpdatableGraffitiProvider(
8282
() -> Optional.of(storageGraffiti), () -> Optional.of(defaultGraffiti));
83-
assertThat(provider.get()).hasValue(storageGraffiti);
83+
assertThat(provider.getWithThrowable()).hasValue(storageGraffiti);
8484
}
8585

8686
@Test
87-
void getWithThrowable_shouldGetDefaultGraffitiWhenStorageEmpty() {
87+
void getWithThrowable_shouldGetDefaultGraffitiWhenStorageEmpty() throws Throwable {
8888
provider = new UpdatableGraffitiProvider(Optional::empty, () -> Optional.of(defaultGraffiti));
89-
assertThat(provider.get()).hasValue(defaultGraffiti);
89+
assertThat(provider.getWithThrowable()).hasValue(defaultGraffiti);
9090
}
9191

9292
@Test
93-
void getWithThrowable_shouldBeEmptyWhenBothEmpty() {
93+
void getWithThrowable_shouldBeEmptyWhenBothEmpty() throws Throwable {
9494
provider = new UpdatableGraffitiProvider(Optional::empty, Optional::empty);
95-
assertThat(provider.get()).isEmpty();
95+
assertThat(provider.getWithThrowable()).isEmpty();
9696
}
9797

9898
@Test

0 commit comments

Comments
 (0)