Merge branch 'stable-3.1'

* stable-3.1:
  Replace ExpectedException with assertThrows

Change-Id: I588311ac96897e1d8ad364a4e1cfd05920ac57ce