Skip to content

Commit 8c801ae

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

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@
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 = mock(ResourceFetcher.class);
2127

2228
@BeforeEach
2329
void setup() {
@@ -28,7 +34,7 @@ void setup() {
2834
}
2935

3036
@Test
31-
void notFetchesResourceFromServer() {
37+
void shouldNotFetchResourcesFromServerIfNotKnown() {
3238
var res = boundedItemStore.get(testRes1Key());
3339

3440
assertThat(res).isNull();
@@ -49,7 +55,7 @@ void getsResourceFromServerIfNotInCache() {
4955
}
5056

5157
@Test
52-
void ifFetchingNotFoundResourceRemovesItFromStore() {
58+
void removesResourcesNotFoundOnServerFromStore() {
5359
boundedItemStore.put(testRes1Key(),
5460
TestUtils.testCustomResource1());
5561
when(resourceFetcher.fetchResource(testRes1Key()))
@@ -75,7 +81,7 @@ void removesResourceFromCache() {
7581
}
7682

7783
@Test
78-
void readingKeySeyNotReadsTheBoundedCache() {
84+
void readingKeySetDoesNotReadFromBoundedCache() {
7985
boundedItemStore.put(testRes1Key(),
8086
TestUtils.testCustomResource1());
8187

@@ -85,7 +91,7 @@ void readingKeySeyNotReadsTheBoundedCache() {
8591
}
8692

8793
@Test
88-
void readingValuesNotReadsTheBoundedCache() {
94+
void readingValuesDoesNotReadFromBoundedCache() {
8995
boundedItemStore.put(testRes1Key(),
9096
TestUtils.testCustomResource1());
9197

0 commit comments

Comments
 (0)