Java 11 migrate c-d (remaining) (#1111)
* Moves converter pattern to Java 11 * Moves cqrs pattern to Java 11 * Moves dao pattern to Java 11 * Moves data-bus pattern to Java 11 * Moves data-locality pattern to Java 11 * Moves data-mapper pattern to Java 11 * Moves data-transfer-object pattern to Java 11 * Moves decorator pattern to Java 11 * Moves delegation pattern to Java 11 * Moves dependency-injection to Java 11 * Moves dirty-flag to Java 11 * Moves double-buffer to Java 11 * Moves double-checked-locking to Java 11 * Moves double-dispatch to Java 11 * Corrects with changes thats breaking test cases
This commit is contained in:
committed by
Ilkka Seppälä
parent
5681684157
commit
ea57934db6
@@ -23,13 +23,14 @@
|
||||
|
||||
package com.iluwatar.dependency.injection;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import com.iluwatar.dependency.injection.utils.InMemoryAppender;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
|
||||
/**
|
||||
* Date: 12/10/15 - 8:40 PM
|
||||
@@ -57,21 +58,22 @@ public class AdvancedWizardTest {
|
||||
@Test
|
||||
public void testSmokeEveryThing() throws Exception {
|
||||
|
||||
final Tobacco[] tobaccos = {
|
||||
new OldTobyTobacco(), new RivendellTobacco(), new SecondBreakfastTobacco()
|
||||
};
|
||||
List<Tobacco> tobaccos = List.of(
|
||||
new OldTobyTobacco(),
|
||||
new RivendellTobacco(),
|
||||
new SecondBreakfastTobacco()
|
||||
);
|
||||
|
||||
for (final Tobacco tobacco : tobaccos) {
|
||||
// Verify if the wizard is smoking the correct tobacco ...
|
||||
tobaccos.forEach(tobacco -> {
|
||||
final AdvancedWizard advancedWizard = new AdvancedWizard(tobacco);
|
||||
advancedWizard.smoke();
|
||||
|
||||
// Verify if the wizard is smoking the correct tobacco ...
|
||||
assertEquals("AdvancedWizard smoking " + tobacco.getClass().getSimpleName(), appender.getLastMessage());
|
||||
|
||||
}
|
||||
String lastMessage = appender.getLastMessage();
|
||||
assertEquals("AdvancedWizard smoking " + tobacco.getClass().getSimpleName(), lastMessage);
|
||||
});
|
||||
|
||||
// ... and nothing else is happening.
|
||||
assertEquals(tobaccos.length, appender.getLogSize());
|
||||
assertEquals(tobaccos.size(), appender.getLogSize());
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user