@Test public void securityErrorType_returnsSecurityMessage() { String expectedString = context.getString(R.string.security_error, "http: assertThat(mapper.getMessage(new FormApiException(SECURITY_ERROR, "http: }
public String getMessage(FormApiException exception) { switch (exception.getType()) { case UNREACHABLE: return TranslationHandler.getString(context, R.string.unreachable_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); case SECURITY_ERROR: return TranslationHandler.getString(context, R.string.security_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); default: return TranslationHandler.getString(context, R.string.report_to_project_lead); } }
FormApiExceptionMapper { public String getMessage(FormApiException exception) { switch (exception.getType()) { case UNREACHABLE: return TranslationHandler.getString(context, R.string.unreachable_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); case SECURITY_ERROR: return TranslationHandler.getString(context, R.string.security_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); default: return TranslationHandler.getString(context, R.string.report_to_project_lead); } } }
FormApiExceptionMapper { public String getMessage(FormApiException exception) { switch (exception.getType()) { case UNREACHABLE: return TranslationHandler.getString(context, R.string.unreachable_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); case SECURITY_ERROR: return TranslationHandler.getString(context, R.string.security_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); default: return TranslationHandler.getString(context, R.string.report_to_project_lead); } } FormApiExceptionMapper(Context context); }
FormApiExceptionMapper { public String getMessage(FormApiException exception) { switch (exception.getType()) { case UNREACHABLE: return TranslationHandler.getString(context, R.string.unreachable_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); case SECURITY_ERROR: return TranslationHandler.getString(context, R.string.security_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); default: return TranslationHandler.getString(context, R.string.report_to_project_lead); } } FormApiExceptionMapper(Context context); String getMessage(FormApiException exception); }
FormApiExceptionMapper { public String getMessage(FormApiException exception) { switch (exception.getType()) { case UNREACHABLE: return TranslationHandler.getString(context, R.string.unreachable_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); case SECURITY_ERROR: return TranslationHandler.getString(context, R.string.security_error, exception.getServerUrl()) + " " + TranslationHandler.getString(context, R.string.report_to_project_lead); default: return TranslationHandler.getString(context, R.string.report_to_project_lead); } } FormApiExceptionMapper(Context context); String getMessage(FormApiException exception);  }