From 59365a3091298405f9feab28126aeee4a04066e8 Mon Sep 17 00:00:00 2001 From: Nic12345678 <162564162+Nic12345678@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:08:41 +0100 Subject: [PATCH] naming convention applied to test methods names --- .../authservice/rest/session/SessionControllerTest.java | 4 ++-- .../authservice/rest/session/SessionCreationTest.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionControllerTest.java b/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionControllerTest.java index 28eac961..9d9b01f6 100644 --- a/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionControllerTest.java +++ b/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionControllerTest.java @@ -90,7 +90,7 @@ private void purgeSessions() throws SQLException { } @Test - public void when_sessionsCreated_sessionsWillBeFound() throws Exception { + public void should_findSessions_when_sessionsCreated() throws Exception { val session1 = createSpringSession_inDB_and_inSessionRegistry_forUser(1, "user1"); val session2 = createSpringSession_inDB_and_inSessionRegistry_forUser(2, "user2"); val session3 = createSpringSession_inDB_and_inSessionRegistry_forUser(3, "user3"); @@ -106,7 +106,7 @@ public void when_sessionsCreated_sessionsWillBeFound() throws Exception { @Test @WithUserDetails - public void when_killingSession_theSessionWillBeKilled() throws Exception { + public void should_killSession_when_killingSessionCalled() throws Exception { val session1 = createSpringSession_inDB_and_inSessionRegistry_forUser(1, "user1"); val session2 = createSpringSession_inDB_and_inSessionRegistry_forUser(2, "user2"); val session3 = createSpringSession_inDB_and_inSessionRegistry_forUser(3, "user3"); diff --git a/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionCreationTest.java b/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionCreationTest.java index b2179556..45831968 100644 --- a/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionCreationTest.java +++ b/wls-auth-service/src/test/java/de/muenchen/oss/wahllokalsystem/authservice/rest/session/SessionCreationTest.java @@ -76,7 +76,7 @@ private void purgeSessions() throws SQLException { } @Test - public void when_noSessionsInDB_noSessionsWillBeFound() throws SQLException { + public void should_notFindSessions_when_noSessionsInDB() throws SQLException { assertEquals( 0, SessionUtils.getSessionIdsFromDatabase(conn).size()); assertEquals( @@ -84,7 +84,7 @@ public void when_noSessionsInDB_noSessionsWillBeFound() throws SQLException { } @Test - public void when_logingInn_sessionIsCreated_inDatabase_and_inSessionRegistry() throws SQLException { + public void should_createSessionInDatabaseAndInSessionRegistry_when_logingInn() throws SQLException { //Get Form and extract csrfToken val formLoginRequest = new RequestEntity<>(HttpMethod.GET, URI.create("http://localhost:" + port + "/login")); val formLoginResponse = testRestTemplate.exchange(formLoginRequest, String.class); @@ -111,7 +111,7 @@ public void when_logingInn_sessionIsCreated_inDatabase_and_inSessionRegistry() t } @Test - public void when_callingLogin_csrfSessionAttributeIsCreated() throws SQLException { + public void should_createCsrfSessionAttribute_when_callingLogin() throws SQLException { val formLoginRequest = new RequestEntity<>(HttpMethod.GET, URI.create("http://localhost:" + port + "/login")); this.testRestTemplate.exchange(formLoginRequest, String.class); val sessionAttributesFromDB = SessionUtils.getSessionAttributeBytesFromDb(conn);