Use assertFailsWith to verify exception cases

Test: atest FrameworksNetTests
Change-Id: If7373a1e6543975bee9c646384f6ca4d643a1711
1 file changed