Skip to content

feat: add e2e tests for assets#285

Open
chaimaMeliani wants to merge 2 commits intomainfrom
272-e2e-test-for-assets
Open

feat: add e2e tests for assets#285
chaimaMeliani wants to merge 2 commits intomainfrom
272-e2e-test-for-assets

Conversation

@chaimaMeliani
Copy link
Contributor

Description
In this PR we. will add the e2e tests for the Asset service.

Closes #272

@chaimaMeliani chaimaMeliani requested a review from ndr-brt March 6, 2026 01:22
@chaimaMeliani chaimaMeliani self-assigned this Mar 6, 2026
Comment on lines +55 to +56
assertThat(created.isSucceeded()).isTrue();
assertThat(created.getContent()).isNotNull();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this test I would also ensure that id returned by the create call is the id we passed in input

Comment on lines +66 to +68
assertThat(asset.isSucceeded()).isTrue();
assertThat(asset.getContent()).isNotNull();
assertThat(asset.getContent().id()).isEqualTo(created.getContent());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should verify that the data contained it's the same as what we passed in input

var created = assets.create(shouldCreateAnAssetRequest());
var updated = assets.update(shouldUpdateAnAssetRequest(created.getContent()));

assertThat(updated.isSucceeded()).isTrue();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should verify that the asset now has effectively changed (also by checking just a single changed attribute)

var created = assets.create(shouldCreateAnAssetRequest());
var deleted = assets.delete(created.getContent());

assertThat(deleted.isSucceeded()).isTrue();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check that the get call should return 404

}

@Nested
class Async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for e2e we can just choose either sync or async and just test one of them, as we know that internally we build the request in the same way and we manage the output in the same way

@chaimaMeliani chaimaMeliani requested a review from ndr-brt March 6, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[e2e tests] Asset CRUD

2 participants