Created
May 25, 2011 12:52
-
-
Save eranharel/990907 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@RunWith(MockitoJUnitRunner.class) | |
public class EmployeeServiceTest { | |
@Mock | |
private EmployeeDao daoMock; | |
@Test | |
public void testFindManagerName() throws Exception { | |
final Long employeeId = 666L; | |
final String expectedManagerName = "Eran Harel"; | |
when(daoMock.findManager(employeeId)).thenReturn(new Employee(expectedManagerName)); | |
final String actualManagerName = new EmployeeService(daoMock).findManagerName(employeeId); | |
assertEquals("expected name", expectedManagerName, actualManagerName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment