Browse Source

Fix counter error in arrayList

feature-serializer
fdai5728 3 years ago
committed by fdai6352
parent
commit
cf2ec72c26
  1. 2
      src/main/java/CredentialRepository.java
  2. 2
      src/test/java/CredentialRepositoryTest.java

2
src/main/java/CredentialRepository.java

@ -2,7 +2,7 @@ import java.util.ArrayList;
public class CredentialRepository implements CredentialRepositoryInterface{
private int idCounter = 1;
private int idCounter = 0;
private ArrayList<Credential> credentials;
public CredentialRepository()

2
src/test/java/CredentialRepositoryTest.java

@ -36,7 +36,7 @@ class CredentialRepositoryTest {
this.credentialRepository.createNewCredential("mock", "mock");
this.credentialRepository.createNewCredential("kek", "mate");
Credential c = this.credentialRepository.getCredentialsViaId(2);
Credential c = this.credentialRepository.getCredentialsViaId(1);
Assertions.assertEquals("mate", c.getPassword());
}

Loading…
Cancel
Save