MDL-70725 oauth2: move expectException to separate method