-
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
702197b
commit 751f0fc
Showing
4 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
hla-product-ordering/backend/src/main/java/com/amigoscode/config/DomainConfiguration.java
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 |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
import com.amigoscode.TestProviderFactory; | ||
import com.amigoscode.TestUserFactory; | ||
import com.amigoscode.appservices.EmailApplicationService; | ||
import com.amigoscode.appservices.IAuthenticationFacade; | ||
import com.amigoscode.appservices.ProviderApplicationService; | ||
import com.amigoscode.domain.email.Email; | ||
import com.amigoscode.domain.order.Order; | ||
import com.amigoscode.domain.order.OrderService; | ||
|
@@ -33,14 +35,17 @@ class EmailControllerIT extends BaseIT { | |
@MockBean | ||
JavaMailSender mailSender; | ||
|
||
@MockBean | ||
IAuthenticationFacade authenticationFacade; | ||
|
||
@Autowired | ||
EmailApplicationService emailApplicationService; | ||
|
||
@Autowired | ||
UserService userService; | ||
|
||
@Autowired | ||
ProviderService providerService; | ||
ProviderApplicationService providerService; | ||
|
||
@Autowired | ||
OrderService orderService; | ||
|
@@ -54,6 +59,7 @@ void user_should_be_able_to_send_email() { | |
Provider provider = TestProviderFactory.create(); | ||
provider.setCreatedBy(savedUser.getId()); | ||
provider.setEmail("[email protected]"); | ||
Mockito.when(authenticationFacade.getLoggedInUserId()).thenReturn(savedUser.getId()); | ||
Provider savedProvider = providerService.save(provider); | ||
Order order1 = orderService.save(TestOrderFactory.create()); | ||
Order order2 = orderService.save(TestOrderFactory.create()); | ||
|
@@ -95,6 +101,7 @@ void user_should_get_information_about_any_email() { | |
Provider provider = TestProviderFactory.create(); | ||
provider.setCreatedBy(savedUser.getId()); | ||
provider.setEmail("[email protected]"); | ||
Mockito.when(authenticationFacade.getLoggedInUserId()).thenReturn(savedUser.getId()); | ||
Provider savedProvider = providerService.save(provider); | ||
Order order1 = orderService.save(TestOrderFactory.create()); | ||
Order order2 = orderService.save(TestOrderFactory.create()); | ||
|
@@ -133,6 +140,7 @@ void admin_should_get_pageable_list_of_orders() { | |
Provider provider = TestProviderFactory.create(); | ||
provider.setCreatedBy(savedUser.getId()); | ||
provider.setEmail("[email protected]"); | ||
Mockito.when(authenticationFacade.getLoggedInUserId()).thenReturn(savedUser.getId()); | ||
Provider savedProvider = providerService.save(provider); | ||
Order order1 = orderService.save(TestOrderFactory.create()); | ||
Order order2 = orderService.save(TestOrderFactory.create()); | ||
|
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 |
---|---|---|
|
@@ -27,14 +27,17 @@ class EmailApplicationServiceIT extends BaseIT { | |
@MockBean | ||
JavaMailSender mailSender; | ||
|
||
@MockBean | ||
IAuthenticationFacade authenticationFacade; | ||
|
||
@Autowired | ||
EmailApplicationService emailApplicationService; | ||
|
||
@Autowired | ||
UserService userService; | ||
|
||
@Autowired | ||
ProviderService providerService; | ||
ProviderApplicationService providerService; | ||
|
||
@Autowired | ||
OrderService orderService; | ||
|
@@ -46,6 +49,7 @@ void should_send_email() { | |
Provider provider = TestProviderFactory.create(); | ||
provider.setCreatedBy(savedUser.getId()); | ||
provider.setEmail("[email protected]"); | ||
Mockito.when(authenticationFacade.getLoggedInUserId()).thenReturn(savedUser.getId()); | ||
Provider savedProvider = providerService.save(provider); | ||
Order order1 = orderService.save(TestOrderFactory.create()); | ||
Order order2 = orderService.save(TestOrderFactory.create()); | ||
|
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