Skip to content

Instantly share code, notes, and snippets.

View adammichalik's full-sized avatar

Adam Michalik adammichalik

  • Rabobank
  • The Netherlands
View GitHub Profile
@adammichalik
adammichalik / SleuthSpanCreatorAspectWebFluxTests.java
Created August 15, 2018 10:07
Reactive SleuthSpanCreatorAspectWebFluxTests
/*
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@adammichalik
adammichalik / 0_salt_35932.sls
Last active September 29, 2016 11:53
SaltStack #35932
/opt/exec.jar:
file.managed:
- source: http://1.2.3.4:8081/service/local/artifact/maven/content?g=com.example&a=example-xxx&v=1.9.0&c=exec&r=releases
- source_hash: http://1.2.3.4:8081/service/local/artifact/maven/content?g=com.example&a=example-xxx&v=1.9.0&c=exec&r=releases&e=jar.sha1
public class JodaTimeSerializationTest {
@Test
public void serializeDateTime() throws JsonProcessingException {
DateTime dateTime = DateTime.parse("2016-01-01T00:00:00Z");
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.configure(WRITE_DATES_AS_TIMESTAMPS , false);
System.out.println(objectMapper.writeValueAsString(dateTime)); // prints "2016-01-01T00:00:00.000Z"
}
}
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import org.junit.Test;
import static org.assertj.core.api.Assertions.*;
public class OrikaIntermediateObjectWithListTest {