use of com.nextcloud.client.account.MockUser in project android by nextcloud.
the class ErrorMessageAdapterIT method getErrorCauseMessageForForbiddenRemoval.
@Test
public void getErrorCauseMessageForForbiddenRemoval() {
Resources resources = InstrumentationRegistry.getInstrumentation().getTargetContext().getResources();
User user = new MockUser("name", ACCOUNT_TYPE);
Context context = MainApp.getAppContext();
String errorMessage = ErrorMessageAdapter.getErrorCauseMessage(new RemoteOperationResult(RemoteOperationResult.ResultCode.FORBIDDEN), new RemoveFileOperation(new OCFile(PATH_TO_DELETE), false, user.toPlatformAccount(), false, context, new FileDataStorageManager(user, context.getContentResolver())), resources);
assertEquals(EXPECTED_ERROR_MESSAGE, errorMessage);
}
Aggregations