-1

I'm trying to perform some unit testing in my application and I've ran into a problem. A simple graph request demands an AccessToken object which can only be claimed by -

AccessToken.getCurrentAccessToken() 

or getting it in an authentication result. Both of the options requires a real authentication process with ui which makes it impossible to unit test. is there a way to create my own AccessToken object? I've tried to use reflection with no luck. any other suggestions?

Ofek Regev
  • 467
  • 4
  • 18

2 Answers2

1

You may use espresso to write UI test and must use real authentication token to test f.b sdk otherwise you must have to skip sdk login test.

Najeeb Idrees
  • 453
  • 6
  • 15
0

if anynone needs a solutions for this problem I've managed to solve this by using Mockito's final classes extension. look at this answer for more details - How to mock a final class with mockito

Ofek Regev
  • 467
  • 4
  • 18