-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07b537d
commit 11a733e
Showing
14 changed files
with
64 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package fr.icdc.ebad.web.rest.dto; | ||
|
||
import lombok.Data; | ||
import org.joda.time.DateTime; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
public class NotificationDto { | ||
private Long id; | ||
private String content; | ||
private DateTime createdDate = DateTime.now(); | ||
private LocalDateTime createdDate = LocalDateTime.now(); | ||
private boolean read = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,11 +113,11 @@ public void requestNewAccreditation() throws EbadServiceException, MessagingExce | |
when(applicationRepository.findById(eq(1L))).thenReturn(Optional.of(accreditationRequest.getApplication())); | ||
when(userService.getUser(any())).thenReturn(Optional.of(User.builder().login("testlogin").email("[email protected]").build())); | ||
|
||
when(accreditationRequestRepository.save(eq(accreditationRequest))).thenReturn(accreditationRequestWithId); | ||
when(accreditationRequestRepository.saveAndFlush(eq(accreditationRequest))).thenReturn(accreditationRequestWithId); | ||
doNothing().when(notificationService).createNotification(any(), any(), eq(false)); | ||
AccreditationRequest result = accreditationRequestService.requestNewAccreditation(1L, true, false); | ||
|
||
verify(accreditationRequestRepository).save(eq(accreditationRequest)); | ||
verify(accreditationRequestRepository).saveAndFlush(eq(accreditationRequest)); | ||
verify(messagingTemplate).convertAndSendToUser(any(), eq("/queue/accreditations"), any()); | ||
verify(mailService).sendMailAccreditation(eq("[email protected]")); | ||
|
||
|
@@ -150,14 +150,14 @@ public void requestNewAccreditationErrorMail() throws EbadServiceException, Mess | |
when(applicationRepository.findById(eq(1L))).thenReturn(Optional.of(accreditationRequest.getApplication())); | ||
when(userService.getUser(any())).thenReturn(Optional.of(User.builder().login("testlogin").email("[email protected]").build())); | ||
|
||
when(accreditationRequestRepository.save(eq(accreditationRequest))).thenReturn(accreditationRequestWithId); | ||
when(accreditationRequestRepository.saveAndFlush(eq(accreditationRequest))).thenReturn(accreditationRequestWithId); | ||
|
||
doThrow(MessagingException.class).when(mailService).sendMailAccreditation(eq("[email protected]")); | ||
|
||
doNothing().when(notificationService).createNotification(any(), any(), eq(false)); | ||
AccreditationRequest result = accreditationRequestService.requestNewAccreditation(1L, true, false); | ||
|
||
verify(accreditationRequestRepository).save(eq(accreditationRequest)); | ||
verify(accreditationRequestRepository).saveAndFlush(eq(accreditationRequest)); | ||
verify(messagingTemplate).convertAndSendToUser(any(), eq("/queue/accreditations"), any()); | ||
verify(mailService).sendMailAccreditation(eq("[email protected]")); | ||
|
||
|
@@ -323,7 +323,7 @@ public void answerToRequestReject() throws EbadServiceException { | |
when(accreditationRequestRepository.findByIdAndState(eq(1L), eq(StateRequest.SENT))).thenReturn(Optional.of(accreditationRequest)); | ||
accreditationRequestService.answerToRequest(1L, false); | ||
|
||
verify(accreditationRequestRepository).save(eq(accreditationRequestRejected)); | ||
verify(accreditationRequestRepository).saveAndFlush(eq(accreditationRequestRejected)); | ||
} | ||
|
||
@Test | ||
|
@@ -357,7 +357,7 @@ public void answerToRequestAccept() throws EbadServiceException { | |
|
||
accreditationRequestService.answerToRequest(1L, true); | ||
|
||
verify(accreditationRequestRepository).save(eq(accreditationRequestAccepted)); | ||
verify(accreditationRequestRepository).saveAndFlush(eq(accreditationRequestAccepted)); | ||
|
||
verify(userService).changeAutorisationApplication(argThat(authorityApplicationDTO -> | ||
"testlogin".equals(authorityApplicationDTO.getLoginUser()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters