Move retrieving APF capabilities into helper function

Retrieving the capabilities will be required for every test, so move it
to a helper function.

Also includes two more minor improvements:
- Use runShellCommandOrThrow() instead of runShellCommand() so we
  correctly fail the test if the shell command returns an error.
- Use truth for all assertions because it creates better error messages.
  See truth.dev for more details.

Test: builds && TH
Change-Id: I61b6263eac9bf70eae4e1841baae9e3fa8ca4d6d
1 file changed