move design patterns to new module (#4206)
* move design patterns to new module * fix logger import
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
4a08fd1352
commit
537c1d1150
@@ -0,0 +1,26 @@
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.baeldung.bridge.Blue;
|
||||
import com.baeldung.bridge.Red;
|
||||
import com.baeldung.bridge.Shape;
|
||||
import com.baeldung.bridge.Square;
|
||||
import com.baeldung.bridge.Triangle;
|
||||
|
||||
public class BridgePatternIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void whenBridgePatternInvoked_thenConfigSuccess() {
|
||||
//a square with red color
|
||||
Shape square = new Square(new Red());
|
||||
assertEquals(square.draw(), "Square drawn. Color is Red");
|
||||
|
||||
//a triangle with blue color
|
||||
Shape triangle = new Triangle(new Blue());
|
||||
assertEquals(triangle.draw(), "Triangle drawn. Color is Blue");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user