Search in sources :

Example 1 with EmployeeRepository

use of com.artezio.arttime.services.repositories.EmployeeRepository in project ART-TIME by Artezio.

the class ManageProjectPermissionFilterTest method testGetEmployeeRepository_ifNull.

@Test
public void testGetEmployeeRepository_ifNull() throws NoSuchFieldException {
    setField(filter, "employeeRepository", null);
    PowerMock.mockStatic(CDIUtils.class);
    expect(CDIUtils.getBean(EmployeeRepository.class)).andReturn(employeeRepository);
    PowerMock.replayAll(CDIUtils.class);
    EmployeeRepository actual = filter.getEmployeeRepository();
    PowerMock.verifyAll();
    assertNotNull(actual);
    assertSame(employeeRepository, actual);
}
Also used : EmployeeRepository(com.artezio.arttime.services.repositories.EmployeeRepository) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 2 with EmployeeRepository

use of com.artezio.arttime.services.repositories.EmployeeRepository in project ART-TIME by Artezio.

the class ManageProjectPermissionFilterTest method testGetEmployeeRepository_ifNotNull.

@Test
public void testGetEmployeeRepository_ifNotNull() throws NoSuchFieldException {
    setField(filter, "employeeRepository", employeeRepository);
    EmployeeRepository actual = filter.getEmployeeRepository();
    assertNotNull(actual);
    assertSame(employeeRepository, actual);
}
Also used : EmployeeRepository(com.artezio.arttime.services.repositories.EmployeeRepository) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

EmployeeRepository (com.artezio.arttime.services.repositories.EmployeeRepository)2 Test (org.junit.Test)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2