How to log in a user and inspect their role in a functional test?
You should be able to load the user object using user_load_by_name(), and then just make your assertions:

$account = user_load_by_name('foo');
$expected_roles = [
  'foo',
  'bar',
];
$this-&gt;assertEquals($expected_roles, $account-&gt;getRoles());


As an aside, it may be worth pursuing a mocked/testing authentication service for your tests. This way they don't rely on an external service, and will be more stable and reliable.