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

Cleanup

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