This repository was archived by the owner on Oct 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,17 @@ func TestCodec_EncodeElasticRecords_IndexColumn(t *testing.T) {
6464 }
6565}
6666
67+ func TestCodec_EncodeElasticRecords_InexistentIndexColumn (t * testing.T ) {
68+ codec := & basicCodec {
69+ config : Config {IndexColumn : "invalid" },
70+ logger : codecLogger ,
71+ }
72+ record , _ , _ := fixtures .NewRecord (time .Now ())
73+
74+ _ , err := codec .EncodeElasticRecords ([]* models.Record {record })
75+ assert .Error (t , err )
76+ }
77+
6778func TestCodec_EncodeElasticRecords_DocIDColumn (t * testing.T ) {
6879 codec := & basicCodec {
6980 config : Config {DocIDColumn : "id" },
@@ -77,3 +88,14 @@ func TestCodec_EncodeElasticRecords_DocIDColumn(t *testing.T) {
7788 assert .Equal (t , strconv .Itoa (int (id )), elasticRecord .ID )
7889 }
7990}
91+
92+ func TestCodec_EncodeElasticRecords_InexistentDocIDColumn (t * testing.T ) {
93+ codec := & basicCodec {
94+ config : Config {DocIDColumn : "invalid" },
95+ logger : codecLogger ,
96+ }
97+ record , _ , _ := fixtures .NewRecord (time .Now ())
98+
99+ _ , err := codec .EncodeElasticRecords ([]* models.Record {record })
100+ assert .Error (t , err )
101+ }
You can’t perform that action at this time.
0 commit comments