Skip to content

Commit c4647a1

Browse files
committed
fix: rename methods more appropriately
1 parent 3cb0ee0 commit c4647a1

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/BoundedItemStoreTest.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111
import static io.javaoperatorsdk.operator.processing.event.source.cache.BoundedItemStore.namespaceKeyFunc;
1212
import static org.assertj.core.api.Assertions.assertThat;
1313
import static org.mockito.ArgumentMatchers.any;
14-
import static org.mockito.Mockito.*;
14+
import static org.mockito.Mockito.mock;
15+
import static org.mockito.Mockito.never;
16+
import static org.mockito.Mockito.times;
17+
import static org.mockito.Mockito.verify;
18+
import static org.mockito.Mockito.when;
1519

1620
class BoundedItemStoreTest {
1721

1822
private BoundedItemStore<TestCustomResource> boundedItemStore;
19-
private BoundedCache<String, TestCustomResource> boundedCache = mock(BoundedCache.class);
20-
private ResourceFetcher<String, TestCustomResource> resourceFetcher = mock(ResourceFetcher.class);
23+
@SuppressWarnings("unchecked")
24+
private final BoundedCache<String, TestCustomResource> boundedCache = mock(BoundedCache.class);
25+
@SuppressWarnings("unchecked")
26+
private final ResourceFetcher<String, TestCustomResource> resourceFetcher =
27+
mock(ResourceFetcher.class);
2128

2229
@BeforeEach
2330
void setup() {
@@ -28,7 +35,7 @@ void setup() {
2835
}
2936

3037
@Test
31-
void notFetchesResourceFromServer() {
38+
void shouldNotFetchResourcesFromServerIfNotKnown() {
3239
var res = boundedItemStore.get(testRes1Key());
3340

3441
assertThat(res).isNull();
@@ -49,7 +56,7 @@ void getsResourceFromServerIfNotInCache() {
4956
}
5057

5158
@Test
52-
void ifFetchingNotFoundResourceRemovesItFromStore() {
59+
void removesResourcesNotFoundOnServerFromStore() {
5360
boundedItemStore.put(testRes1Key(),
5461
TestUtils.testCustomResource1());
5562
when(resourceFetcher.fetchResource(testRes1Key()))
@@ -75,7 +82,7 @@ void removesResourceFromCache() {
7582
}
7683

7784
@Test
78-
void readingKeySeyNotReadsTheBoundedCache() {
85+
void readingKeySetDoesNotReadFromBoundedCache() {
7986
boundedItemStore.put(testRes1Key(),
8087
TestUtils.testCustomResource1());
8188

@@ -85,7 +92,7 @@ void readingKeySeyNotReadsTheBoundedCache() {
8592
}
8693

8794
@Test
88-
void readingValuesNotReadsTheBoundedCache() {
95+
void readingValuesDoesNotReadFromBoundedCache() {
8996
boundedItemStore.put(testRes1Key(),
9097
TestUtils.testCustomResource1());
9198

0 commit comments

Comments
 (0)