palantir / atlasdb

Transactional Distributed Database Layer
https://palantir.github.io/atlasdb/
Apache License 2.0
45 stars 7 forks source link

Prefer AssertJ #7089

Closed barisoyoruk closed 2 months ago

barisoyoruk commented 2 months ago

Replica of the excavator https://github.com/palantir/atlasdb/pull/7058/files with some corrections.

Prefer assertJ instead of jupiter assertions. The excavator didn't work because in here

MultiCheckAndSetException ex =
                assertThatThrownBy(() -> keyValueService.multiCheckAndSet(request)).isInstanceOf(MultiCheckAndSetException.class);

assertThatThrownBy does not return the exception captured. Instead we should use catchThrowableOfType which already verifies the instance of automatically and return the exception.