|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2017 the original author or authors. |
| 2 | + * Copyright 2012-2018 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
17 | 17 | package org.springframework.boot.autoconfigure.data.rest;
|
18 | 18 |
|
19 | 19 | import java.net.URI;
|
20 |
| -import java.util.Date; |
21 |
| -import java.util.Map; |
22 | 20 |
|
23 |
| -import com.fasterxml.jackson.core.JsonProcessingException; |
24 |
| -import com.fasterxml.jackson.databind.ObjectMapper; |
25 | 21 | import org.junit.After;
|
26 | 22 | import org.junit.Test;
|
27 | 23 |
|
@@ -146,31 +142,6 @@ public void backOffWithCustomConfiguration() {
|
146 | 142 | assertThat(bean.getBaseUri()).isEqualTo(URI.create(""));
|
147 | 143 | }
|
148 | 144 |
|
149 |
| - @Test |
150 |
| - public void objectMappersAreConfiguredUsingObjectMapperBuilder() |
151 |
| - throws JsonProcessingException { |
152 |
| - load(TestConfigurationWithObjectMapperBuilder.class); |
153 |
| - |
154 |
| - assertThatDateIsFormattedCorrectly("halObjectMapper"); |
155 |
| - assertThatDateIsFormattedCorrectly("objectMapper"); |
156 |
| - } |
157 |
| - |
158 |
| - @Test |
159 |
| - public void primaryObjectMapperIsAvailable() { |
160 |
| - load(TestConfiguration.class); |
161 |
| - Map<String, ObjectMapper> objectMappers = this.context |
162 |
| - .getBeansOfType(ObjectMapper.class); |
163 |
| - assertThat(objectMappers.size()).isGreaterThan(1); |
164 |
| - this.context.getBean(ObjectMapper.class); |
165 |
| - } |
166 |
| - |
167 |
| - public void assertThatDateIsFormattedCorrectly(String beanName) |
168 |
| - throws JsonProcessingException { |
169 |
| - ObjectMapper objectMapper = this.context.getBean(beanName, ObjectMapper.class); |
170 |
| - assertThat(objectMapper.writeValueAsString(new Date(1413387983267L))) |
171 |
| - .isEqualTo("\"2014-10\""); |
172 |
| - } |
173 |
| - |
174 | 145 | private void load(Class<?> config, String... environment) {
|
175 | 146 | AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
|
176 | 147 | applicationContext.setServletContext(new MockServletContext());
|
|
0 commit comments