Skip to content

Commit

Permalink
[plugin-csv] Respect CSV format configuration by step saving CSV to v…
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst authored Apr 25, 2024
1 parent 3ee9ef3 commit ee8d6c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<constructor-arg type="java.lang.Character" value="${csv.escape-char:#{null}}" />
</bean>

<bean factory-bean="csvFormatFactory" factory-method="getCsvFormat" />
<bean id="csvFormat" factory-bean="csvFormatFactory" factory-method="getCsvFormat" />

<bean class="org.vividus.csv.CsvReader" />
<bean class="org.vividus.csv.CsvReader">
<constructor-arg ref="csvFormat" />
</bean>

<bean id="FROM_CSV" class="org.vividus.csv.transformer.CsvTableTransformer" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ batch-1.resource-location=story/system
batch-1.resource-include-patterns=*.story
batch-1.threads=5

csv.delimiter-char=;

azure.cosmos-db.container.test.id=Items
azure.cosmos-db.container.test.db-key=task

Expand Down
9 changes: 9 additions & 0 deletions vividus-tests/src/main/resources/story/system/CSV.story
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Meta:
@epic vividus-plugin-csv

Scenario: Validate step: "When I save CSV `$csv` to $scopes variable `$variableName`" with non-default delimiter char
Given I initialize scenario variable `csv-as-string` with value `key1;key2;key3
val1-1;val1-2;val1-3
val2-1;val2-2;val2-3`
When I save CSV `${csv-as-string}` to scenario variable `csv`
Then `${csv[1].key2}` is equal to `val2-2`

0 comments on commit ee8d6c5

Please sign in to comment.