Skip to content

Commit

Permalink
naming convention applied to test methods names
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic12345678 committed Nov 26, 2024
1 parent fb76e1e commit 59365a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ 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(
0, SessionUtils.getSessionAttributeBytesFromDb(conn).size());
}

@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);
Expand All @@ -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);
Expand Down

0 comments on commit 59365a3

Please sign in to comment.