Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
docs: Add testing documentation (#210)
Browse files Browse the repository at this point in the history
Add testing doc
  • Loading branch information
jimmarino authored Sep 2, 2024
1 parent 896b2cf commit f8ee9b8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions developer/wip/for-adopters/edc-testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Testing

EDC provides a JUnit test fixture for running automated integration tests. The EDC JUnit runtime offers a number of advantages:

- Fast build time since container images do not need to be built and deployed
- Launch and debug tests directly within an IDE
- Easily write asynchronous tests using libraries such as [Awaitility](http://www.awaitility.org/)

The JUnit runtime can be configured to include custom extensions. Running multiple instances as part of a single test setup is also possible. The following demonstrates how to set up and launch a basic test using JUnit's `RegisterExtension` annotation and the `RuntimePerClassExtension`:

```java
@EndToEndTest
class Basic01basicConnectorTest {

@RegisterExtension
static RuntimeExtension connector = new RuntimePerClassExtension(new EmbeddedRuntime(
"connector",
emptyMap(),
":basic:basic-01-basic-connector"
));

@Test
void shouldStartConnector() {
assertThat(connector.getService(Clock.class)).isNotNull();
}
}
```

For more details and examples, check out the [EDC Samples system tests](https://github.com/eclipse-edc/Samples/tree/main/system-tests).

0 comments on commit f8ee9b8

Please sign in to comment.