Java 11 migration: patterns (t-v) (#1085)
* Moves visitor pattern to java 11 * Moves value-object pattern to java 11 * Moves unit-of-work pattern to java 11 * Moves typeobjectpattern pattern to java 11 * Moves twin pattern to java 11 * Moves trampoline pattern to java 11 * Moves tolerant-reader pattern to java 11 * Moves tls pattern to java 11 * Moves throttling pattern to java 11 * Moves thread-pool pattern to java 11 * Moves template-method pattern to java 11
This commit is contained in:
committed by
Ilkka Seppälä
parent
160b737dcc
commit
50467c9e76
@ -23,12 +23,12 @@
|
||||
|
||||
package com.iluwatar.templatemethod;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Date: 12/29/15 - 18:15 PM
|
||||
*
|
||||
@ -41,8 +41,8 @@ public class HalflingThiefTest {
|
||||
*/
|
||||
@Test
|
||||
public void testSteal() {
|
||||
final StealingMethod method = mock(StealingMethod.class);
|
||||
final HalflingThief thief = new HalflingThief(method);
|
||||
final var method = mock(StealingMethod.class);
|
||||
final var thief = new HalflingThief(method);
|
||||
|
||||
thief.steal();
|
||||
verify(method).steal();
|
||||
@ -55,13 +55,13 @@ public class HalflingThiefTest {
|
||||
*/
|
||||
@Test
|
||||
public void testChangeMethod() {
|
||||
final StealingMethod initialMethod = mock(StealingMethod.class);
|
||||
final HalflingThief thief = new HalflingThief(initialMethod);
|
||||
final var initialMethod = mock(StealingMethod.class);
|
||||
final var thief = new HalflingThief(initialMethod);
|
||||
|
||||
thief.steal();
|
||||
verify(initialMethod).steal();
|
||||
|
||||
final StealingMethod newMethod = mock(StealingMethod.class);
|
||||
final var newMethod = mock(StealingMethod.class);
|
||||
thief.changeMethod(newMethod);
|
||||
|
||||
thief.steal();
|
||||
|
Reference in New Issue
Block a user