-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Bridge | ||
|
||
Bridge component is used for accessing the DI container of the application. When the application is started, the bridge | ||
is | ||
created and the DI container is accessed in the tests. | ||
|
||
If you want to access to the beans of the application, you can simply do: | ||
|
||
```kotlin | ||
// setup | ||
TestSystem() | ||
.with { | ||
//other deps... | ||
bridge() | ||
} | ||
|
||
// while writing tests | ||
validate { | ||
using<YourBean> { | ||
this.doSomething() | ||
} | ||
|
||
using<Bean1, Bean2> { bean1, bean2 -> | ||
bean1.doSomething() | ||
bean2.doSomething() | ||
} | ||
} | ||
``` | ||
|
||
Both Spring-Boot and Ktor have `bridge` function built-in, so you don't have to add any extra dependency than | ||
`com-trendyol:stove-ktor-testing-e2e` or `com-trendyol-stove-spring-testing-e2e`. If you are using Spring-Boot, the | ||
bridge will be referring to the`ApplicationContext` and if you are using Ktor, it will be referring to the | ||
`Application`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters