Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void modifyPassword(Account alreadySavedAccount, String newCredentialPass
accountRepository.save(new Account(alreadySavedAccount.getSite(), new Credential(alreadySavedAccount.getCredential().getUsername(), newCredentialPassword)));
accountView.accountIsModified();
}else {
accountView.showError("Can't find any account for selected site with specified username");
accountView.showAccountRelatedError("Can't find any account for selected site with specified password");
}

}
Expand All @@ -71,7 +71,7 @@ public void modifyUsername(Account alreadySavedAccount, String newCredentialUser
accountRepository.save(new Account(alreadySavedAccount.getSite(), new Credential(newCredentialUsername,alreadySavedAccount.getCredential().getPassword())));
accountView.accountIsModified();
}else {
accountView.showError("Can't find any account for selected site with specified username");
accountView.showAccountRelatedError("Can't find any account for selected site with specified username");
}

}
Expand All @@ -81,7 +81,7 @@ public void delete(Account accountToDelete) {
accountRepository.delete(accountToDelete);
accountView.accountIsDeleted();
}else {
accountView.showError("Can't find any account for selected site");
accountView.showAccountRelatedError("Can't find any account for selected site");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void modifyAccountPasswordWhenAccountDoesntExistsNotOperationPerfomedTest
String newCredentialPassword = "passMoreSecure123";
when(accountRepository.findByKey(site)).thenReturn(Arrays.asList(new Account("github.com", new Credential("remegiulio","remepassword"))));
controller.modifyPassword(new Account("github.com", new Credential("giulio","passgiulio")), newCredentialPassword);
verify(accountView).showError("Can't find any account for selected site with specified username");
verify(accountView).showAccountRelatedError("Can't find any account for selected site with specified password");
verifyNoMoreInteractions(ignoreStubs(accountRepository));
}

Expand All @@ -152,7 +152,7 @@ public void modifyAccountUsernameWhenAccountDoesntExistsNotOperationPerfomedTest
String newCredentialUsername = "remeic";
when(accountRepository.findByKey(site)).thenReturn(Arrays.asList(new Account("github.com", new Credential("remegiulio","remepassword"))));
controller.modifyUsername(new Account("github.com", new Credential("giulio","passgiulio")), newCredentialUsername);
verify(accountView).showError("Can't find any account for selected site with specified username");
verify(accountView).showAccountRelatedError("Can't find any account for selected site with specified username");
verifyNoMoreInteractions(ignoreStubs(accountRepository));
}

Expand All @@ -173,7 +173,7 @@ public void deleteAccountNotExistsNoPerformOperationTest() {
Account accountToDelete = new Account("github.com", new Credential("remegiulio","remepassword"));
when(accountRepository.findByKey(site)).thenReturn(Arrays.asList(accountToDelete));
controller.delete( new Account("github.com", new Credential("giulio","remepassword")));
verify(accountView).showError("Can't find any account for selected site");
verify(accountView).showAccountRelatedError("Can't find any account for selected site");
verifyNoMoreInteractions(ignoreStubs(accountRepository));
}

Expand Down