Skip to content

Commit

Permalink
Fix transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
edeandrea committed Jan 2, 2025
1 parent 54898da commit 339b11d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private String updateStatus(long claimId, String status) {
}

@Transactional
Optional<Claim> updateStatusIfFound(long claimId, String status) {
public Optional<Claim> updateStatusIfFound(long claimId, String status) {
return Claim.<Claim>findByIdOptional(claimId)
.map(claim -> {
// Capitalize the first letter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.quarkiverse.mailpit.test.model.Message;

@QuarkusTest
@TestTransaction
@WithMailbox
class NotificationServiceTests {
@InjectMailbox
Expand All @@ -40,11 +39,12 @@ void afterEach() {
}

@Test
@TestTransaction
void emailSendsWhenUserExists() {
var status = "Denied";
var claimId = 1L;
var claim = Claim.<Claim>findByIdOptional(claimId)
.orElseThrow(() -> new IllegalArgumentException("Marty McFly's claim should be found!"));
.orElseThrow(() -> new IllegalArgumentException("Marty McFly's claim should be found!"));

assertThat(this.emailService.updateClaimStatus(claimId, status))
.isNotNull()
Expand Down

0 comments on commit 339b11d

Please sign in to comment.