### Question:
JDBCUserDatabase extends AbstractUserDatabase { @Override public void deleteByLoginName( final String loginName ) throws NoSuchPrincipalException, WikiSecurityException { findByLoginName( loginName ); try( final Connection conn = m_ds.getConnection() ; final PreparedStatement ps1 = conn.prepareStatement( m_deleteUserByLoginName ); final PreparedStatement ps2 = conn.prepareStatement( m_deleteRoleByLoginName ) ) { if( m_supportsCommits ) { conn.setAutoCommit( false ); } ps1.setString( 1, loginName ); ps1.execute(); ps2.setString( 1, loginName ); ps2.execute(); if( m_supportsCommits ) { conn.commit(); } } catch( final SQLException e ) { throw new WikiSecurityException( e.getMessage(), e ); } }  @Override void deleteByLoginName( final String loginName ); @Override UserProfile findByEmail( final String index ); @Override UserProfile findByFullName( final String index ); @Override UserProfile findByLoginName( final String index ); @Override UserProfile findByUid( final String uid ); @Override UserProfile findByWikiName( final String index ); @Override Principal[] getWikiNames(); @Override void initialize( final Engine engine, final Properties props ); @Override void rename( final String loginName, final String newName ); @Override void save( final UserProfile profile ); static final String DEFAULT_DB_ATTRIBUTES; static final String DEFAULT_DB_CREATED; static final String DEFAULT_DB_EMAIL; static final String DEFAULT_DB_FULL_NAME; static final String DEFAULT_DB_JNDI_NAME; static final String DEFAULT_DB_LOCK_EXPIRY; static final String DEFAULT_DB_MODIFIED; static final String DEFAULT_DB_ROLE; static final String DEFAULT_DB_ROLE_TABLE; static final String DEFAULT_DB_TABLE; static final String DEFAULT_DB_LOGIN_NAME; static final String DEFAULT_DB_PASSWORD; static final String DEFAULT_DB_UID; static final String DEFAULT_DB_WIKI_NAME; static final String PROP_DB_ATTRIBUTES; static final String PROP_DB_CREATED; static final String PROP_DB_EMAIL; static final String PROP_DB_FULL_NAME; static final String PROP_DB_DATASOURCE; static final String PROP_DB_LOCK_EXPIRY; static final String PROP_DB_LOGIN_NAME; static final String PROP_DB_MODIFIED; static final String PROP_DB_PASSWORD; static final String PROP_DB_UID; static final String PROP_DB_ROLE; static final String PROP_DB_ROLE_TABLE; static final String PROP_DB_TABLE; static final String PROP_DB_WIKI_NAME; }### Answer:
@Test public void testDeleteByLoginName() throws WikiSecurityException { int oldUserCount = m_db.getWikiNames().length; String loginName = "TestUser" + String.valueOf( System.currentTimeMillis() ); UserProfile profile = m_db.newProfile(); profile.setEmail("jspwiki.tests@mailinator.com"); profile.setLoginName( loginName ); profile.setFullname( "FullName"+loginName ); profile.setPassword("password"); m_db.save(profile); profile = m_db.findByLoginName( loginName ); Assertions.assertEquals( loginName, profile.getLoginName() ); Assertions.assertEquals( oldUserCount+1, m_db.getWikiNames().length ); m_db.deleteByLoginName( loginName ); Assertions.assertEquals( oldUserCount, m_db.getWikiNames().length ); }