* #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices * #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices
This commit is contained in:
@ -54,7 +54,7 @@ public class App {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// The captain can only operate rowing boats but with adapter he is able to use fishing boats as well
|
||||
Captain captain = new Captain(new FishingBoatAdapter());
|
||||
var captain = new Captain(new FishingBoatAdapter());
|
||||
captain.row();
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class AdapterPatternTest {
|
||||
FishingBoatAdapter fishingBoatAdapter = spy(new FishingBoatAdapter());
|
||||
beans.put(FISHING_BEAN, fishingBoatAdapter);
|
||||
|
||||
Captain captain = new Captain();
|
||||
var captain = new Captain();
|
||||
captain.setRowingBoat((FishingBoatAdapter) beans.get(FISHING_BEAN));
|
||||
beans.put(ROWING_BEAN, captain);
|
||||
}
|
||||
@ -66,13 +66,13 @@ public class AdapterPatternTest {
|
||||
*/
|
||||
@Test
|
||||
public void testAdapter() {
|
||||
Captain captain = (Captain) beans.get(ROWING_BEAN);
|
||||
var captain = (Captain) beans.get(ROWING_BEAN);
|
||||
|
||||
// when captain moves
|
||||
captain.row();
|
||||
|
||||
// the captain internally calls the battleship object to move
|
||||
RowingBoat adapter = (RowingBoat) beans.get(FISHING_BEAN);
|
||||
var adapter = (RowingBoat) beans.get(FISHING_BEAN);
|
||||
verify(adapter).row();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user