#984 local variable inference changes (#1025)

* #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:
Anurag870
2019-10-20 21:31:02 +05:30
committed by Ilkka Seppälä
parent 2217fbc5ff
commit f00ebe1a8d
12 changed files with 33 additions and 52 deletions

View File

@ -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();
}
}

View File

@ -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();
}
}