22
33import static org .assertj .core .api .Assertions .assertThat ;
44
5+ import com .scalar .db .io .BigIntColumn ;
56import com .scalar .db .io .BigIntValue ;
6- import com .scalar .db .io .BlobValue ;
7- import com .scalar .db .io .BooleanValue ;
8- import com .scalar .db .io .DoubleValue ;
9- import com .scalar .db .io .FloatValue ;
10- import com .scalar .db .io .IntValue ;
11- import com .scalar .db .io .TextValue ;
7+ import com .scalar .db .io .BlobColumn ;
8+ import com .scalar .db .io .BooleanColumn ;
9+ import com .scalar .db .io .DoubleColumn ;
10+ import com .scalar .db .io .FloatColumn ;
11+ import com .scalar .db .io .IntColumn ;
12+ import com .scalar .db .io .TextColumn ;
1213import java .nio .charset .StandardCharsets ;
1314import java .util .Base64 ;
1415import org .junit .jupiter .api .BeforeEach ;
1516import org .junit .jupiter .api .Test ;
1617
1718public class ConcatenationVisitorTest {
1819 private static final boolean ANY_BOOLEAN = false ;
19- private static final BooleanValue ANY_BOOLEAN_VALUE =
20- new BooleanValue ("any_boolean" , ANY_BOOLEAN );
20+ private static final BooleanColumn ANY_BOOLEAN_COLUMN =
21+ BooleanColumn . of ("any_boolean" , ANY_BOOLEAN );
2122 private static final int ANY_INT = Integer .MIN_VALUE ;
22- private static final IntValue ANY_INT_VALUE = new IntValue ("any_int" , ANY_INT );
23+ private static final IntColumn ANY_INT_COLUMN = IntColumn . of ("any_int" , ANY_INT );
2324 private static final long ANY_BIGINT = BigIntValue .MAX_VALUE ;
24- private static final BigIntValue ANY_BIGINT_VALUE = new BigIntValue ("any_bigint" , ANY_BIGINT );
25+ private static final BigIntColumn ANY_BIGINT_COLUMN = BigIntColumn . of ("any_bigint" , ANY_BIGINT );
2526 private static final float ANY_FLOAT = Float .MIN_NORMAL ;
26- private static final FloatValue ANY_FLOAT_VALUE = new FloatValue ("any_float" , ANY_FLOAT );
27+ private static final FloatColumn ANY_FLOAT_COLUMN = FloatColumn . of ("any_float" , ANY_FLOAT );
2728 private static final double ANY_DOUBLE = Double .MIN_NORMAL ;
28- private static final DoubleValue ANY_DOUBLE_VALUE = new DoubleValue ("any_double" , ANY_DOUBLE );
29+ private static final DoubleColumn ANY_DOUBLE_COLUMN = DoubleColumn . of ("any_double" , ANY_DOUBLE );
2930 private static final String ANY_TEXT = "test" ;
30- private static final TextValue ANY_TEXT_VALUE = new TextValue ("any_text" , ANY_TEXT );
31+ private static final TextColumn ANY_TEXT_COLUMN = TextColumn . of ("any_text" , ANY_TEXT );
3132 private static final byte [] ANY_BLOB = "scalar" .getBytes (StandardCharsets .UTF_8 );
32- private static final BlobValue ANY_BLOB_VALUE = new BlobValue ("any_blob" , ANY_BLOB );
33+ private static final BlobColumn ANY_BLOB_COLUMN = BlobColumn . of ("any_blob" , ANY_BLOB );
3334 private ConcatenationVisitor visitor ;
3435
3536 @ BeforeEach
@@ -40,13 +41,13 @@ public void setUp() {
4041 @ Test
4142 public void build_AllTypesGiven_ShouldBuildString () {
4243 // Act
43- visitor .visit (ANY_BOOLEAN_VALUE );
44- visitor .visit (ANY_INT_VALUE );
45- visitor .visit (ANY_BIGINT_VALUE );
46- visitor .visit (ANY_FLOAT_VALUE );
47- visitor .visit (ANY_DOUBLE_VALUE );
48- visitor .visit (ANY_TEXT_VALUE );
49- visitor .visit (ANY_BLOB_VALUE );
44+ visitor .visit (ANY_BOOLEAN_COLUMN );
45+ visitor .visit (ANY_INT_COLUMN );
46+ visitor .visit (ANY_BIGINT_COLUMN );
47+ visitor .visit (ANY_FLOAT_COLUMN );
48+ visitor .visit (ANY_DOUBLE_COLUMN );
49+ visitor .visit (ANY_TEXT_COLUMN );
50+ visitor .visit (ANY_BLOB_COLUMN );
5051 String actual = visitor .build ();
5152
5253 // Assert
@@ -63,63 +64,63 @@ public void build_AllTypesGiven_ShouldBuildString() {
6364 }
6465
6566 @ Test
66- public void visit_BooleanValueAcceptCalled_ShouldBuildBooleanAsString () {
67+ public void visit_BooleanColumnAcceptCalled_ShouldBuildBooleanAsString () {
6768 // Act
68- ANY_BOOLEAN_VALUE .accept (visitor );
69+ ANY_BOOLEAN_COLUMN .accept (visitor );
6970
7071 // Assert
7172 assertThat (visitor .build ()).isEqualTo (String .valueOf (ANY_BOOLEAN ));
7273 }
7374
7475 @ Test
75- public void visit_IntValueAcceptCalled_ShouldBuildIntAsString () {
76+ public void visit_IntColumnAcceptCalled_ShouldBuildIntAsString () {
7677 // Act
77- ANY_INT_VALUE .accept (visitor );
78+ ANY_INT_COLUMN .accept (visitor );
7879
7980 // Assert
8081 assertThat (visitor .build ()).isEqualTo (String .valueOf (ANY_INT ));
8182 }
8283
8384 @ Test
84- public void visit_BigIntValueAcceptCalled_ShouldBuildBigIntAsString () {
85+ public void visit_BigIntColumnAcceptCalled_ShouldBuildBigIntAsString () {
8586 // Act
86- ANY_BIGINT_VALUE .accept (visitor );
87+ ANY_BIGINT_COLUMN .accept (visitor );
8788
8889 // Assert
8990 assertThat (visitor .build ()).isEqualTo (String .valueOf (ANY_BIGINT ));
9091 }
9192
9293 @ Test
93- public void visit_FloatValueAcceptCalled_ShouldBuildFloatAsString () {
94+ public void visit_FloatColumnAcceptCalled_ShouldBuildFloatAsString () {
9495 // Act
95- ANY_FLOAT_VALUE .accept (visitor );
96+ ANY_FLOAT_COLUMN .accept (visitor );
9697
9798 // Assert
9899 assertThat (visitor .build ()).isEqualTo (String .valueOf (ANY_FLOAT ));
99100 }
100101
101102 @ Test
102- public void visit_DoubleValueAcceptCalled_ShouldBuildDoubleAsString () {
103+ public void visit_DoubleColumnAcceptCalled_ShouldBuildDoubleAsString () {
103104 // Act
104- ANY_DOUBLE_VALUE .accept (visitor );
105+ ANY_DOUBLE_COLUMN .accept (visitor );
105106
106107 // Assert
107108 assertThat (visitor .build ()).isEqualTo (String .valueOf (ANY_DOUBLE ));
108109 }
109110
110111 @ Test
111- public void visit_TextValueAcceptCalled_ShouldBuildText () {
112+ public void visit_TextColumnAcceptCalled_ShouldBuildText () {
112113 // Act
113- ANY_TEXT_VALUE .accept (visitor );
114+ ANY_TEXT_COLUMN .accept (visitor );
114115
115116 // Assert
116117 assertThat (visitor .build ()).isEqualTo (ANY_TEXT );
117118 }
118119
119120 @ Test
120- public void visit_BlobValueAcceptCalled_ShouldBuildBlobAsString () {
121+ public void visit_BlobColumnAcceptCalled_ShouldBuildBlobAsString () {
121122 // Act
122- ANY_BLOB_VALUE .accept (visitor );
123+ ANY_BLOB_COLUMN .accept (visitor );
123124
124125 // Assert
125126 assertThat (visitor .build ())
0 commit comments