diff --git a/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupSignatureIntegrationTests.java b/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupSignatureIntegrationTests.java index bac4a5c35..a6bd1e6ba 100644 --- a/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupSignatureIntegrationTests.java +++ b/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupSignatureIntegrationTests.java @@ -441,9 +441,7 @@ public void signAupOnBehalfOfUserThatHasNoSignature() throws Exception { @Test @WithMockUser(username = "test", roles = {"USER"}) public void testSignAupThrowExceptionForServiceAccount() throws Exception { - IamAup aup = buildDefaultAup(); - aupRepo.save(aup); - + IamAccount testAccount = accountRepo.findByUsername("test").orElseThrow(); testAccount.setServiceAccount(true); accountRepo.save(testAccount);