Browse Source

Implements function for Username Update

feature-credentialneu
fdai5728 3 years ago
parent
commit
cbb280326f
  1. 7
      src/main/java/CredentialRepository.java
  2. 2
      src/test/java/CredentialRepositoryTest.java

7
src/main/java/CredentialRepository.java

@ -74,6 +74,13 @@ public class CredentialRepository implements CredentialRepositoryInterface{
public void updateUsername(int index, String newUsername){
try{
this.credentials.get(index).updateUsername(newUsername);
}
catch (IndexOutOfBoundsException outOfBoundsException)
{
}
}
@Override

2
src/test/java/CredentialRepositoryTest.java

@ -69,7 +69,7 @@ class CredentialRepositoryTest {
Credential c = this.credentialRepository.getCredentialsViaId(0);
Assertions.assertEquals("newPassword", c.getName());
Assertions.assertEquals("newUsername", c.getName());
}

Loading…
Cancel
Save