TSK-726 Add HistoryPluginLoaderTests with profile option
This commit is contained in:
parent
ee792510d9
commit
6ec72b16d3
|
@ -30,6 +30,7 @@ function main {
|
||||||
(cd $REL/../web && npm run test)
|
(cd $REL/../web && npm run test)
|
||||||
mvn clean verify -q -f $REL/../lib/ -B
|
mvn clean verify -q -f $REL/../lib/ -B
|
||||||
mvn clean install -q -f $REL/../rest/ -B
|
mvn clean install -q -f $REL/../rest/ -B
|
||||||
|
mvn clean verify -q -f $REL/../rest/ -B -pl taskana-rest-spring-example -P history.plugin
|
||||||
else
|
else
|
||||||
mvn clean verify -q -f $REL/../lib/taskana-core -B
|
mvn clean verify -q -f $REL/../lib/taskana-core -B
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -22,7 +22,6 @@ public final class HistoryEventProducer {
|
||||||
private ServiceLoader<TaskanaHistory> serviceLoader;
|
private ServiceLoader<TaskanaHistory> serviceLoader;
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
|
|
||||||
public static synchronized HistoryEventProducer getInstance(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
public static synchronized HistoryEventProducer getInstance(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||||
if (emitterInstance == null) {
|
if (emitterInstance == null) {
|
||||||
emitterInstance = new HistoryEventProducer(taskanaEngineConfiguration);
|
emitterInstance = new HistoryEventProducer(taskanaEngineConfiguration);
|
||||||
|
|
|
@ -11,7 +11,6 @@ public class TaskCompletionEvent extends TaskHistoryEvent {
|
||||||
super(completedTask);
|
super(completedTask);
|
||||||
type = "TASK_COMPLETED";
|
type = "TASK_COMPLETED";
|
||||||
created = completedTask.getCompleted();
|
created = completedTask.getCompleted();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,13 @@ public class TaskHistoryEvent extends TaskanaHistoryEvent {
|
||||||
if (!task.getAttachments().isEmpty()) {
|
if (!task.getAttachments().isEmpty()) {
|
||||||
attachmentClassificationKey = task.getAttachments().get(0).getClassificationSummary().getKey();
|
attachmentClassificationKey = task.getAttachments().get(0).getClassificationSummary().getKey();
|
||||||
}
|
}
|
||||||
porCompany = task.getPrimaryObjRef().getCompany();
|
if (task.getPrimaryObjRef() != null) {
|
||||||
porSystem = task.getPrimaryObjRef().getSystem();
|
porCompany = task.getPrimaryObjRef().getCompany();
|
||||||
porInstance = task.getPrimaryObjRef().getSystemInstance();
|
porSystem = task.getPrimaryObjRef().getSystem();
|
||||||
porType = task.getPrimaryObjRef().getType();
|
porInstance = task.getPrimaryObjRef().getSystemInstance();
|
||||||
porValue = task.getPrimaryObjRef().getValue();
|
porType = task.getPrimaryObjRef().getType();
|
||||||
|
porValue = task.getPrimaryObjRef().getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTaskId() {
|
public String getTaskId() {
|
||||||
|
|
|
@ -223,10 +223,8 @@ public class TaskServiceImpl implements TaskService {
|
||||||
task.setOwner(userId);
|
task.setOwner(userId);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug("Task '{}' completed by user '{}'.", taskId, userId);
|
LOGGER.debug("Task '{}' completed by user '{}'.", taskId, userId);
|
||||||
|
|
||||||
if (HistoryEventProducer.isHistoryEnabled()) {
|
if (HistoryEventProducer.isHistoryEnabled()) {
|
||||||
TaskCompletionEvent event = new TaskCompletionEvent(task);
|
historyEventProducer.createEvent(new TaskCompletionEvent(task));
|
||||||
historyEventProducer.createEvent(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package acceptance.history;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import acceptance.AbstractAccTest;
|
||||||
|
import pro.taskana.history.HistoryEventProducer;
|
||||||
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Acceptance test for historyEventProducer class.
|
||||||
|
*/
|
||||||
|
public class HistoryEventProducerTest extends AbstractAccTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHistoryEventProducerIsNotEnabled() {
|
||||||
|
HistoryEventProducer historyEventProducer = ((TaskanaEngineImpl) taskanaEngine).getHistoryEventProducer();
|
||||||
|
assertEquals(false, historyEventProducer.isEnabled());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,80 +1,78 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-spring-example</artifactId>
|
<artifactId>taskana-spring-example</artifactId>
|
||||||
<version>1.0.5-SNAPSHOT</version>
|
<version>1.0.5-SNAPSHOT</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.0.2.RELEASE</version>
|
<version>2.0.2.RELEASE</version>
|
||||||
<relativePath />
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
|
<properties>
|
||||||
<properties>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
</properties>
|
||||||
</properties>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
<dependencies>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<dependency>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
</dependency>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.springframework</groupId>
|
||||||
<dependency>
|
<artifactId>spring-context</artifactId>
|
||||||
<groupId>org.springframework</groupId>
|
</dependency>
|
||||||
<artifactId>spring-context</artifactId>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<dependency>
|
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
</dependency>
|
||||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.springframework</groupId>
|
||||||
<dependency>
|
<artifactId>spring-tx</artifactId>
|
||||||
<groupId>org.springframework</groupId>
|
</dependency>
|
||||||
<artifactId>spring-tx</artifactId>
|
<dependency>
|
||||||
</dependency>
|
<groupId>com.h2database</groupId>
|
||||||
<dependency>
|
<artifactId>h2</artifactId>
|
||||||
<groupId>com.h2database</groupId>
|
</dependency>
|
||||||
<artifactId>h2</artifactId>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<dependency>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
</dependency>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<dependency>
|
||||||
</dependency>
|
<groupId>pro.taskana</groupId>
|
||||||
<dependency>
|
<artifactId>taskana-core</artifactId>
|
||||||
<groupId>pro.taskana</groupId>
|
<version>${project.version}</version>
|
||||||
<artifactId>taskana-core</artifactId>
|
</dependency>
|
||||||
<version>${project.version}</version>
|
<dependency>
|
||||||
</dependency>
|
<groupId>pro.taskana</groupId>
|
||||||
<dependency>
|
<artifactId>taskana-spring</artifactId>
|
||||||
<groupId>pro.taskana</groupId>
|
<version>${project.version}</version>
|
||||||
<artifactId>taskana-spring</artifactId>
|
</dependency>
|
||||||
<version>${project.version}</version>
|
<dependency>
|
||||||
</dependency>
|
<groupId>junit</groupId>
|
||||||
<dependency>
|
<artifactId>junit</artifactId>
|
||||||
<groupId>junit</groupId>
|
<version>4.12</version>
|
||||||
<artifactId>junit</artifactId>
|
<scope>test</scope>
|
||||||
<version>4.12</version>
|
</dependency>
|
||||||
<scope>test</scope>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.hamcrest</groupId>
|
||||||
<dependency>
|
<artifactId>hamcrest-library</artifactId>
|
||||||
<groupId>org.hamcrest</groupId>
|
<version>1.3</version>
|
||||||
<artifactId>hamcrest-library</artifactId>
|
<scope>test</scope>
|
||||||
<version>1.3</version>
|
</dependency>
|
||||||
<scope>test</scope>
|
</dependencies>
|
||||||
</dependency>
|
<build>
|
||||||
</dependencies>
|
<plugins>
|
||||||
<build>
|
<!-- Package as an executable jar/war -->
|
||||||
<plugins>
|
<plugin>
|
||||||
<!-- Package as an executable jar/war -->
|
<groupId>org.springframework.boot</groupId>
|
||||||
<plugin>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
</plugin>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
</plugins>
|
||||||
</plugin>
|
</build>
|
||||||
</plugins>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
</build>
|
<url>http://taskana.pro</url>
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<description>The Taskana Spring sample application.</description>
|
||||||
<url>http://taskana.pro</url>
|
|
||||||
<description>The Taskana Spring sample application.</description>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -8,7 +8,6 @@ import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.ArgumentMatchers.argThat;
|
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
|
@ -23,11 +22,9 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.ArgumentMatcher;
|
|
||||||
import org.mockito.Captor;
|
import org.mockito.Captor;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.slf4j.event.Level;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||||
|
@ -37,8 +34,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
import ch.qos.logback.classic.Logger;
|
|
||||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
|
||||||
import ch.qos.logback.classic.spi.LoggingEvent;
|
import ch.qos.logback.classic.spi.LoggingEvent;
|
||||||
import ch.qos.logback.core.Appender;
|
import ch.qos.logback.core.Appender;
|
||||||
import pro.taskana.exceptions.DomainNotFoundException;
|
import pro.taskana.exceptions.DomainNotFoundException;
|
||||||
|
@ -47,6 +42,7 @@ import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.exceptions.TaskanaException;
|
import pro.taskana.exceptions.TaskanaException;
|
||||||
import pro.taskana.exceptions.WorkbasketAlreadyExistException;
|
import pro.taskana.exceptions.WorkbasketAlreadyExistException;
|
||||||
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
||||||
|
import pro.taskana.history.HistoryEventProducer;
|
||||||
import pro.taskana.impl.TaskImpl;
|
import pro.taskana.impl.TaskImpl;
|
||||||
import pro.taskana.impl.TaskanaEngineImpl;
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
import pro.taskana.impl.WorkbasketImpl;
|
import pro.taskana.impl.WorkbasketImpl;
|
||||||
|
@ -63,7 +59,7 @@ import pro.taskana.transaction.TaskanaTransactionProvider;
|
||||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||||
@ActiveProfiles({"inmemorydb", "dev"})
|
@ActiveProfiles({"inmemorydb", "dev"})
|
||||||
@Import({TransactionalJobsConfiguration.class})
|
@Import({TransactionalJobsConfiguration.class})
|
||||||
public class TaskanaTransactionTest {
|
public class TaskanaTransactionIntTest {
|
||||||
|
|
||||||
private static final int POOL_TIME_TO_WAIT = 50;
|
private static final int POOL_TIME_TO_WAIT = 50;
|
||||||
|
|
|
@ -35,6 +35,42 @@
|
||||||
<spring.ldap.version>2.3.2.RELEASE</spring.ldap.version>
|
<spring.ldap.version>2.3.2.RELEASE</spring.ldap.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>history.plugin</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>false</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<build.profile.id>history.plugin</build.profile.id>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana.simplehistory</groupId>
|
||||||
|
<artifactId>taskana-simplehistory-provider</artifactId>
|
||||||
|
<version>0.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.0</version>
|
||||||
|
<configuration>
|
||||||
|
<includes>
|
||||||
|
<include>**/*Plugin*Test.java</include>
|
||||||
|
</includes>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/Test/*.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
|
@ -67,7 +103,7 @@
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>1.4.197</version>
|
<version>1.4.197</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ibm.db2.jcc</groupId>
|
<groupId>com.ibm.db2.jcc</groupId>
|
||||||
<artifactId>db2jcc4</artifactId>
|
<artifactId>db2jcc4</artifactId>
|
||||||
|
@ -134,6 +170,18 @@
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Required for skip plugin tests by default -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.0</version>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/*Plugin*Test.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<!-- Required for generation of REST documentation -->
|
<!-- Required for generation of REST documentation -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package pro.taskana.historyPlugin;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import pro.taskana.TaskanaEngine;
|
||||||
|
import pro.taskana.history.HistoryEventProducer;
|
||||||
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
|
import pro.taskana.rest.RestConfiguration;
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = RestConfiguration.class)
|
||||||
|
public class HistoryPluginLoaderTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataSource dataSource;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHistoryEventProducerIsEnabled() {
|
||||||
|
HistoryEventProducer historyEventProducer = ((TaskanaEngineImpl) taskanaEngine).getHistoryEventProducer();
|
||||||
|
assertEquals(historyEventProducer.isEnabled(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -15,7 +15,6 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
@ -86,6 +85,8 @@ public class AsyncUpdateJobIntTest {
|
||||||
|
|
||||||
// 1st step: get old classification :
|
// 1st step: get old classification :
|
||||||
Instant before = Instant.now();
|
Instant before = Instant.now();
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
String updatedClassification;
|
||||||
|
|
||||||
ResponseEntity<ClassificationResource> response = template.exchange(
|
ResponseEntity<ClassificationResource> response = template.exchange(
|
||||||
"http://127.0.0.1:" + port + "/v1/classifications/CLI:100000000000000000000000000000000003",
|
"http://127.0.0.1:" + port + "/v1/classifications/CLI:100000000000000000000000000000000003",
|
||||||
|
@ -103,7 +104,7 @@ public class AsyncUpdateJobIntTest {
|
||||||
classification.setServiceLevel("P5D");
|
classification.setServiceLevel("P5D");
|
||||||
classification.setPriority(1000);
|
classification.setPriority(1000);
|
||||||
|
|
||||||
String updatedClassification = new JSONObject(classification).toString();
|
updatedClassification = mapper.writeValueAsString(classification);
|
||||||
|
|
||||||
URL url = new URL(server + port + "/v1/classifications/CLI:100000000000000000000000000000000003");
|
URL url = new URL(server + port + "/v1/classifications/CLI:100000000000000000000000000000000003");
|
||||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||||
|
@ -201,7 +202,7 @@ public class AsyncUpdateJobIntTest {
|
||||||
converter.setSupportedMediaTypes(MediaType.parseMediaTypes("application/hal+json"));
|
converter.setSupportedMediaTypes(MediaType.parseMediaTypes("application/hal+json"));
|
||||||
converter.setObjectMapper(mapper);
|
converter.setObjectMapper(mapper);
|
||||||
|
|
||||||
RestTemplate template = new RestTemplate(Collections.<HttpMessageConverter<?>> singletonList(converter));
|
RestTemplate template = new RestTemplate(Collections.<HttpMessageConverter<?>>singletonList(converter));
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue