citrusframework / citrusframework/citrus
API inconsistency in chaining .sqlResource()
- Dominant language
- Java
- Stars
- 485
- Forks
- 155
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 6
Description
**Citrus Version**
2.8.0
**Expected behavior**
Using chained `sqlResource()` configurations should execute all given parameters on its `String` and its `Resource` signature.
**Actual behavior**
- On the `Resource` signature, all given sql statements are executed
- On the `String` signature, only the last given resource file is executed.
**Test case sample**
Only `foobar.sql` is executed
```java
sql(action -> action.dataSource(dataSource)
.sqlResource("classpath:sql/foo.sql")
.sqlResource("classpath:sql/bar.sql")
.sqlResource("classpath:sql/foobar.sql")
);
```
All statements are executed
```java
sql(action -> action.dataSource(dataSource)
.sqlResource(new ClassPathResource("classpath:sql/foo.sql"))
.sqlResource(new ClassPathResource("classpath:sql/bar.sql"))
.sqlResource(new ClassPathResource("classpath:sql/foobar.sql"))
);
```
Contributor guide
Assessment
This issue has not been assessed yet.