Add null check in RefreshScopeHealthIndicator. Fixes #397. (#398)

This commit is contained in:
Ryan Baxter
2018-07-26 15:09:05 -04:00
committed by GitHub
parent 84659685d6
commit 57ab7ed469
2 changed files with 21 additions and 13 deletions

View File

@@ -81,4 +81,11 @@ public class RefreshScopeHealthIndicatorTests {
assertEquals(Status.DOWN, this.indicator.health().getStatus());
}
@Test
public void nullRefreshScope() {
ObjectProvider<RefreshScope> scopeProvider = mock(ObjectProvider.class);
BDDMockito.willReturn(null).given(scopeProvider).getIfAvailable();
assertEquals(Status.UP, this.indicator.health().getStatus());
}
}