added logging if exceptions are thrown and made variables in test final