Commit 4d6774a5 authored by Matija Obreza's avatar Matija Obreza

Dependencies upgraded

- Spring Framework
- Spring Data JPA
- Spring Security
- Spring OAuth2
- Liquibase
- Jackson
parent 5f111e36
......@@ -71,11 +71,10 @@
<servlet-api.version>2.5</servlet-api.version>
<jsp-api.version>2.1</jsp-api.version>
<spring.framework.version>4.3.8.RELEASE</spring.framework.version>
<spring-data-jpa.version>1.10.4.RELEASE</spring-data-jpa.version>
<spring.data.release-train>Hopper-SR1</spring.data.release-train>
<spring.security.version>4.1.3.RELEASE</spring.security.version>
<spring.security.oauth2.version>2.0.14.RELEASE</spring.security.oauth2.version>
<spring.framework.version>4.3.18.RELEASE</spring.framework.version>
<spring-data-jpa.version>1.11.13.RELEASE</spring-data-jpa.version>
<spring.security.version>4.1.5.RELEASE</spring.security.version>
<spring.security.oauth2.version>2.3.3.RELEASE</spring.security.oauth2.version>
<org.springframework.social-version>1.1.4.RELEASE</org.springframework.social-version>
<org.springframework.social-google-version>1.0.0.RELEASE</org.springframework.social-google-version>
<querydsl.version>4.1.4</querydsl.version>
......@@ -93,9 +92,9 @@
<hazelcast.version>3.8.1</hazelcast.version>
<oval.version>1.81</oval.version>
<jackson.version>2.6.4</jackson.version>
<jackson.version>2.9.6</jackson.version>
<jaxb-api.version>2.2.12</jaxb-api.version>
<liquibase.version>3.5.3</liquibase.version>
<liquibase.version>3.6</liquibase.version>
<swagger.version>2.9.2</swagger.version>
<!--Container -->
......@@ -107,31 +106,6 @@
</properties>
<dependencies>
<!--Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<version>1.0.1.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
......@@ -235,6 +209,19 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate4</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
......@@ -283,14 +270,6 @@
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
......@@ -308,6 +287,7 @@
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
......@@ -355,11 +335,6 @@
<version>${oval.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
......@@ -451,26 +426,6 @@
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-google</artifactId>
<version>${org.springframework.social-google-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-web</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
......@@ -539,8 +494,8 @@
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<version>${liquibase.version}</version>
</dependency>
<dependency>
......@@ -563,6 +518,56 @@
<artifactId>semver4j</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-google</artifactId>
<version>${org.springframework.social-google-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-web</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<!--Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<version>1.2.4.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......
......@@ -27,6 +27,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.genesys2.server.exception.InvalidApiUsageException;
import org.genesys2.server.model.filters.AutocompleteFilter;
import org.genesys2.server.model.filters.BasicFilter;
import org.genesys2.server.model.filters.CodedMethodFilter;
......@@ -303,7 +304,7 @@ public class FilterHandler {
if ("like".equals(op)) {
String startsWith = jp.nextTextValue();
if (startsWith == null || StringUtils.isBlank(startsWith))
throw new JsonParseException("StartsWithFilter expects a non-blank string", jp.getCurrentLocation());
throw new JsonParseException("StartsWithFilter expects a non-blank string", jp.getCurrentLocation(), new InvalidApiUsageException("StartsWithFilter expects a non-blank string"));
af.addFilterValue(new StartsWithFilter(startsWith));
} else if ("min".equals(op)) {
......@@ -316,7 +317,7 @@ public class FilterHandler {
}
if (number1 == null)
throw new JsonParseException("MinValueFilter expects a single numeric value", jp.getCurrentLocation());
throw new JsonParseException("MinValueFilter expects a single numeric value", jp.getCurrentLocation(), new InvalidApiUsageException("MinValueFilter expects a single numeric value"));
af.addFilterValue(new MinValueFilter(number1));
} else if ("dateMin".equals(op)) {
......@@ -327,7 +328,7 @@ public class FilterHandler {
}
if (value == null)
throw new JsonParseException("MinValueFilter for date expects a single string value", jp.getCurrentLocation());
throw new JsonParseException("MinValueFilter for date expects a single string value", jp.getCurrentLocation(), new InvalidApiUsageException("MinValueFilter for date expects a single string value"));
af.addFilterValue(new MinValueFilter(value));
} else if ("max".equals(op)) {
......
......@@ -136,7 +136,7 @@ public class OAuthManagementController extends BaseController {
@PreAuthorize("hasAnyRole('VETTEDUSER','ADMINISTRATOR')")
@RequestMapping(value = "/save-client", method = RequestMethod.POST, params = "action-save")
public @ResponseBody OAuthClient createClientEntry(Model model, @RequestBody @JsonView(JsonViews.Protected.class) OAuthClient client) {
public @ResponseBody OAuthClient createClientEntry(Model model, @RequestBody OAuthClient client) {
OAuthClient oauthClient = clientDetailsService.addClient(client);
LOG.info("Created OAuth client with clientId={}", oauthClient.getClientId());
......@@ -172,7 +172,7 @@ public class OAuthManagementController extends BaseController {
@RequestMapping(value = "/save-client", method = RequestMethod.POST, params = { "id", "version", "action-save" }, consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaType.APPLICATION_JSON_VALUE })
public @ResponseBody OAuthClient saveExistingClient(Model model, @RequestBody @JsonView(JsonViews.Protected.class) OAuthClient updates, @RequestParam("id") long id,
public @ResponseBody OAuthClient saveExistingClient(Model model, @RequestBody OAuthClient updates, @RequestParam("id") long id,
@RequestParam("version") int version) {
final OAuthClient clientDetails = clientDetailsService.updateClient(id, version, updates);
......
......@@ -23,11 +23,6 @@ import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.genesys2.spring.AddStuffInterceptor;
import org.genesys2.spring.RequestAttributeLocaleResolver;
import org.genesys2.spring.RequestTrackingInterceptor;
......@@ -36,7 +31,11 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Scope;
import org.springframework.http.CacheControl;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
......@@ -59,6 +58,12 @@ import org.springframework.web.servlet.theme.ThemeChangeInterceptor;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module;
/**
* Spring MVC
*
......@@ -209,7 +214,7 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
final MappingJackson2HttpMessageConverter messageConverter = new MappingJackson2HttpMessageConverter();
final ObjectMapper mapper = new ObjectMapper();
// mapper.registerModule(new Hibernate4Module());
mapper.registerModule(new Hibernate4Module());
// serialization
mapper.disable(SerializationFeature.EAGER_SERIALIZER_FETCH);
// deserialization
......
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