Skip to content

Instantly share code, notes, and snippets.

View derkork's full-sized avatar

Jan Thomä derkork

  • Leipzig, Germany
View GitHub Profile
@derkork
derkork / gist:45d7fba64b54a41608e1
Created March 25, 2015 08:00
Testing service implementations without creating a spring context.
class SomeServiceImplTest extends Specification {
SomeServiceImpl underTest
SomeDao someDao
SomeOtherService someOtherService
void setup() {
// create the instance under test
underTest = new SomeServiceImpl()
@derkork
derkork / gist:7907114
Created December 11, 2013 08:57
The Activiti workflow engine keeps the metadata of all historic processes in it's database so you can query it later. Over time this meatdata can grow to quite significant amounts (several gigabytes). In many cases it is not required to save this metadata forever. This is an example how to clean up historic process metadata from the Activiti dat…
package de.janthomae.activiti;
import org.activiti.engine.HistoryService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Required;
import java.text.DateFormat;