assertTrue(IOUtils.contentEquals(new FileInputStream(tempFile),
issueClient.getAttachment(pm, attachments.iterator().next().getContentUri())));
}
private void changeUserLanguageByValueOrName(String value, String name) {
final UserProfile userProfile = navigation.userProfile();
boolean fallbackToChangeByValue = false;
try {
Method changeUserLanguageByValue = userProfile.getClass().getMethod("changeUserLanguageByValue", String.class);
changeUserLanguageByValue.invoke(userProfile, value);
} catch (NoSuchMethodException e) {
// fallbackToChangeByValue to value - for JIRA < 5.1
fallbackToChangeByValue = true;
} catch (InvocationTargetException e) {
fallbackToChangeByValue = true;
} catch (IllegalAccessException e) {
fallbackToChangeByValue = true;
}
if (fallbackToChangeByValue) {
userProfile.changeUserLanguage(name);
}
}