Merge branch 'master' into master
This commit is contained in:
@ -3,7 +3,6 @@ layout: pattern
|
||||
title: Bridge
|
||||
folder: bridge
|
||||
permalink: /patterns/bridge/
|
||||
pumlid: BSR14SCm20J0Lf82BFxf1akCJ4R26ZZYzkE7zxLljJgoIVfu7S2A3v7pLRhYo3r3l9u6CPHwJjAH5uETllpZhKbejsqn86v1a-CExQwj2mdgqv8-oyev_W00
|
||||
categories: Structural
|
||||
tags:
|
||||
- Java
|
||||
|
@ -29,13 +29,18 @@
|
||||
<parent>
|
||||
<groupId>com.iluwatar</groupId>
|
||||
<artifactId>java-design-patterns</artifactId>
|
||||
<version>1.17.0-SNAPSHOT</version>
|
||||
<version>1.19.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bridge</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
package com.iluwatar.bridge;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -22,11 +22,10 @@
|
||||
*/
|
||||
package com.iluwatar.bridge;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Tests for hammer
|
||||
|
@ -22,11 +22,10 @@
|
||||
*/
|
||||
package com.iluwatar.bridge;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Tests for sword
|
||||
|
@ -22,10 +22,11 @@
|
||||
*/
|
||||
package com.iluwatar.bridge;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.internal.verification.VerificationModeFactory.times;
|
||||
|
||||
/**
|
||||
* Base class for weapon tests
|
||||
@ -44,15 +45,15 @@ public abstract class WeaponTest {
|
||||
assertNotNull(weapon.getEnchantment());
|
||||
|
||||
weapon.swing();
|
||||
verify(enchantment, times(1)).apply();
|
||||
verify(enchantment).apply();
|
||||
verifyNoMoreInteractions(enchantment);
|
||||
|
||||
weapon.wield();
|
||||
verify(enchantment, times(1)).onActivate();
|
||||
verify(enchantment).onActivate();
|
||||
verifyNoMoreInteractions(enchantment);
|
||||
|
||||
weapon.unwield();
|
||||
verify(enchantment, times(1)).onDeactivate();
|
||||
verify(enchantment).onDeactivate();
|
||||
verifyNoMoreInteractions(enchantment);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user