Browse Source

Updates Interface and function signatures

feature-credentialneu
fdai5728 3 years ago
parent
commit
a048e3572c
  1. 10
      src/main/java/CredentialRepository.java
  2. 4
      src/main/java/CredentialRepositoryInterface.java
  3. 13
      src/test/java/CredentialRepositoryTest.java

10
src/main/java/CredentialRepository.java

@ -60,13 +60,19 @@ public class CredentialRepository implements CredentialRepositoryInterface{
@Override @Override
public void updatePassword(int index) {
public void updatePassword(int index, String newPassword) {
try{
}
catch (IndexOutOfBoundsException outOfBoundsException)
{
}
} }
public void updateUsername(int index){
public void updateUsername(int index, String newUsername){
} }

4
src/main/java/CredentialRepositoryInterface.java

@ -3,8 +3,8 @@ public interface CredentialRepositoryInterface {
int createNewCredential(String name, String password); int createNewCredential(String name, String password);
Credential getCredentialsViaName(String needle); Credential getCredentialsViaName(String needle);
Credential getCredentialsViaId(int id); Credential getCredentialsViaId(int id);
void updatePassword(int index);
void updateUsername(int index);
void updatePassword(int index, String newPassword);
void updateUsername(int indexl, String newUsername);
void delete(int index); void delete(int index);
} }

13
src/test/java/CredentialRepositoryTest.java

@ -49,13 +49,12 @@ class CredentialRepositoryTest {
} }
}
@Test
void testUpdatePassword(){
// this.credentialRepository.createNewCredential("mock", "mock");
// this.credentialRepository.updatePassword(0);
/*
Exception failed = Assertions.assertThrows(Exception.class, () -> {
this.credentialRepository.createNewCredential(null,null);
});
}
Assertions.assertEquals("kein leeres Objekt erstellen", failed.getMessage());
*/
}
Loading…
Cancel
Save