Created
March 14, 2024 15:16
-
-
Save FranckSilvestre/e5fbd26e33755f595c27440cdce0719a to your computer and use it in GitHub Desktop.
v1 on OurBusinessProject 2023-2024
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
package ourbusinessproject; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.extension.ExtendWith; | |
import org.mockito.Mock; | |
import org.mockito.junit.jupiter.MockitoExtension; | |
import static org.mockito.Mockito.verify; | |
@ExtendWith(MockitoExtension.class) | |
class ProjectControllerTest { | |
@Mock | |
private EnterpriseProjectService enterpriseProjectService; | |
private ProjectController projectController; | |
@BeforeEach | |
public void setUp() { | |
projectController = new ProjectController(enterpriseProjectService); | |
} | |
@Test | |
public void testControllerDelegationToService() { | |
// when requesting for all projects | |
projectController.findAllProjectsWithEnterprises(); | |
// then the request is performed by the enterprise project service | |
verify(enterpriseProjectService).findAllProjects(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment