citrusframework / citrusframework/citrus

API inconsistency in chaining .sqlResource()

Open
#701 0 comments 0 reactions 0 assignees View on GitHub
bug prio-medium
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.