如何在下面的模拟对象中设置值。 我知道如何获取值但是如何使用mock设置值?
public class AUTest
{
Set<String> permissionIds = new HashSet<String>();
@Mock
UserService userservice;
@Mock
PermissionService permissionservice;
Set<String> emailid = new HashSet<String>();
@Test
public void getSuperUserPermissions()
{
List<Permissions> allPermissions = permissionservice.getAllPermissions();
PermissionService permission = Mockito.mock(PermissionService.class);
Mockito.when(permission.getPermissionById(5L)).thenReturn(pemission);
Assert.assertNotNull(allPermissions);
}
}