File tree Expand file tree Collapse file tree
main/java/br/com/cezarcruz/javabank/gateway/out/cache/redis
test/java/br/com/cezarcruz/javabank/gateway/out/schedule Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ dependencies {
3030 compileOnly ' org.projectlombok:lombok'
3131 developmentOnly ' org.springframework.boot:spring-boot-devtools'
3232 annotationProcessor ' org.projectlombok:lombok'
33+
3334 testImplementation ' org.springframework.boot:spring-boot-starter-test'
3435 testImplementation ' io.projectreactor:reactor-test'
3536 testRuntimeOnly ' org.junit.platform:junit-platform-launcher' // temp
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11package br .com .cezarcruz .javabank .gateway .out .schedule ;
22
3- import br .com .cezarcruz .javabank .gateway .out .cache .redis . RedisCacheWrapper ;
3+ import br .com .cezarcruz .javabank .gateway .out .cache .Cache ;
44import org .junit .jupiter .api .Test ;
55import org .junit .jupiter .api .extension .ExtendWith ;
66import org .mockito .InjectMocks ;
7- import org .mockito .Mock ;
7+ import org .mockito .Spy ;
88import org .mockito .junit .jupiter .MockitoExtension ;
99
10- import static org .mockito .ArgumentMatchers .any ;
11- import static org .mockito .Mockito .doNothing ;
12- import static org .mockito .Mockito .verify ;
13-
1410@ ExtendWith (MockitoExtension .class )
1511class UpdateCacheSchedulerTest {
1612
17- @ Mock
18- private RedisCacheWrapper redisCache ;
13+ @ Spy
14+ private Cache cache = new Cache () {
15+ @ Override
16+ public void put (String key ) {
17+ System .out .println (key );
18+ }
19+ };
1920
2021 @ InjectMocks
2122 private UpdateCacheScheduler updateCacheScheduler ;
2223
2324 @ Test
2425 void justRun () {
25- doNothing ().when (redisCache ).put (any ());
2626 updateCacheScheduler .run ();
27-
28- verify (redisCache ).put (any ());
2927 }
3028
3129}
You can’t perform that action at this time.
0 commit comments