Commit 9afc28c6 authored by Matija Obreza's avatar Matija Obreza
Browse files

Cleanup

parent 32319b64
......@@ -92,6 +92,7 @@ public class DatabaseConfig {
dataSource.setTestWhileIdle(true);
dataSource.setTestOnBorrow(true);
dataSource.setMaxActive(dbPoolMaxActive);
dataSource.setMaxIdle(dbPoolInitialSize);
dataSource.setInitialSize(dbPoolInitialSize);
dataSource.setMinIdle(dbPoolInitialSize);
return dataSource;
......
......@@ -76,32 +76,5 @@
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring.data.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
......@@ -48,7 +48,8 @@
<querydsl.version>4.1.4</querydsl.version>
<spring.security.version>4.1.3.RELEASE</spring.security.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<hsqldb.version>2.3.4</hsqldb.version>
<hsqldb.version>2.4.0</hsqldb.version>
<tomcat-jdbc.version>8.5.8</tomcat-jdbc.version>
<ehcache.version>2.7.4</ehcache.version>
</properties>
......@@ -165,6 +166,41 @@
<version>3.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring.data.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
......@@ -180,6 +216,20 @@
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>${tomcat-jdbc.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -135,6 +135,7 @@
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
......@@ -151,34 +152,18 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>8.5.8</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate4</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>${hibernate.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
</dependencies>
......
......@@ -36,6 +36,7 @@ public class SecurityContextUtil {
/**
* @return current user
*/
@SuppressWarnings("unchecked")
public static <T extends BasicUser<?>> T getMe() {
final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
......@@ -46,6 +47,7 @@ public class SecurityContextUtil {
}
}
@SuppressWarnings("unchecked")
public static <T extends BasicUser<?>> T getCurrentUser() {
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
......
......@@ -21,7 +21,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.security.acls.domain.AuditLogger;
import org.springframework.security.acls.model.AccessControlEntry;
import org.springframework.security.acls.model.AuditableAccessControlEntry;
import org.springframework.util.Assert;
public class Slf4jLogAuditLogger implements AuditLogger {
......@@ -29,9 +28,7 @@ public class Slf4jLogAuditLogger implements AuditLogger {
@Override
public void logIfNeeded(boolean granted, AccessControlEntry ace) {
Assert.notNull(ace, "AccessControlEntry required");
if (ace instanceof AuditableAccessControlEntry) {
if (ace != null && ace instanceof AuditableAccessControlEntry) {
final AuditableAccessControlEntry auditableAce = (AuditableAccessControlEntry) ace;
if (granted && auditableAce.isAuditSuccess()) {
......@@ -40,6 +37,5 @@ public class Slf4jLogAuditLogger implements AuditLogger {
LOG.debug("DENIED due to ACE: " + ace);
}
}
}
}
......@@ -92,6 +92,7 @@ public class DatabaseConfig {
dataSource.setTestWhileIdle(true);
dataSource.setTestOnBorrow(true);
dataSource.setMaxActive(dbPoolMaxActive);
dataSource.setMaxIdle(dbPoolInitialSize);
dataSource.setInitialSize(dbPoolInitialSize);
dataSource.setMinIdle(dbPoolInitialSize);
return dataSource;
......
......@@ -3,7 +3,7 @@ moc
db.url=jdbc:hsqldb:mem:test;sql.syntax_mys=true;sql.ignore_case=true
db.driverClassName=org.hsqldb.jdbc.JDBCDriver
db.hibernate.dialect=org.genesys.blocks.util.BetterHSQLDialect
db.showSql=true
db.showSql=false
db.updateSchema=true
# Connection pool
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment