From 2d2d1bd527b4f7f99d780e960c6eefea25a7dbc8 Mon Sep 17 00:00:00 2001 From: fdai5728 Date: Wed, 16 Feb 2022 17:52:52 +0100 Subject: [PATCH] Implements Unittest for Username Update --- src/test/java/CredentialRepositoryTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/CredentialRepositoryTest.java b/src/test/java/CredentialRepositoryTest.java index c7298fb..dcd87a5 100644 --- a/src/test/java/CredentialRepositoryTest.java +++ b/src/test/java/CredentialRepositoryTest.java @@ -61,4 +61,16 @@ class CredentialRepositoryTest { } + @Test + void testUpdateUsername(){ + + this.credentialRepository.createNewCredential("mock", "mock"); + this.credentialRepository.updateUsername(0, "newUsername"); + + Credential c = this.credentialRepository.getCredentialsViaId(0); + + Assertions.assertEquals("newPassword", c.getName()); + + } + }