Browse Source

Implements function for Username Update

feature-serializer
fdai5728 3 years ago
committed by fdai6352
parent
commit
2ad4ea87c4
  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){ public void updateUsername(int index, String newUsername){
try{
this.credentials.get(index).updateUsername(newUsername);
}
catch (IndexOutOfBoundsException outOfBoundsException)
{
}
} }
@Override @Override

2
src/test/java/CredentialRepositoryTest.java

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

Loading…
Cancel
Save