@Test
  public void badStateTransitionsTest() throws Exception {
    // write after close.
    doBadStateTransitionTest(TestingUri.WriteAfterClose, IOException.class);

    // modify response data after it has been written to the channel
    doBadStateTransitionTest(TestingUri.ModifyResponseMetadataAfterWrite, IllegalStateException.class);
  }
Performs bad state transitions and verifies that they throw the right exceptions.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/NettyResponseChannelTest.java