From 2fc29d96ce043fc34ce395dd7cc8c71458a0c1d9 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 2 Feb 2022 16:04:51 +0100 Subject: [PATCH] Move inner test classes to top-level classes to run these by the Maven build. Original Pull Request: #2253 --- ...FlatteningJackson2HashMapperUnitTests.java | 27 ++++++++++++++++++ .../mapping/Jackson2HashMapperUnitTests.java | 15 +--------- ...FlatteningJackson2HashMapperUnitTests.java | 28 +++++++++++++++++++ 3 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 src/test/java/org/springframework/data/redis/mapping/FlatteningJackson2HashMapperUnitTests.java create mode 100644 src/test/java/org/springframework/data/redis/mapping/NonFlatteningJackson2HashMapperUnitTests.java diff --git a/src/test/java/org/springframework/data/redis/mapping/FlatteningJackson2HashMapperUnitTests.java b/src/test/java/org/springframework/data/redis/mapping/FlatteningJackson2HashMapperUnitTests.java new file mode 100644 index 000000000..e2b980d84 --- /dev/null +++ b/src/test/java/org/springframework/data/redis/mapping/FlatteningJackson2HashMapperUnitTests.java @@ -0,0 +1,27 @@ +/* + * Copyright 2022 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.redis.mapping; + +import org.springframework.data.redis.hash.Jackson2HashMapper; + +/** + * @author Mark Paluch + */ +public class FlatteningJackson2HashMapperUnitTests extends Jackson2HashMapperUnitTests { + FlatteningJackson2HashMapperUnitTests() { + super(new Jackson2HashMapper(true)); + } +} diff --git a/src/test/java/org/springframework/data/redis/mapping/Jackson2HashMapperUnitTests.java b/src/test/java/org/springframework/data/redis/mapping/Jackson2HashMapperUnitTests.java index 59c10ffbc..280e6b78a 100644 --- a/src/test/java/org/springframework/data/redis/mapping/Jackson2HashMapperUnitTests.java +++ b/src/test/java/org/springframework/data/redis/mapping/Jackson2HashMapperUnitTests.java @@ -42,7 +42,7 @@ import org.springframework.data.redis.hash.Jackson2HashMapper; * @author Christoph Strobl * @author Mark Paluch */ -public abstract class Jackson2HashMapperUnitTests extends AbstractHashMapperTests { +abstract class Jackson2HashMapperUnitTests extends AbstractHashMapperTests { private final Jackson2HashMapper mapper; @@ -50,19 +50,6 @@ public abstract class Jackson2HashMapperUnitTests extends AbstractHashMapperTest this.mapper = mapper; } - public static class FlatteningJackson2HashMapperUnitTests extends Jackson2HashMapperUnitTests { - FlatteningJackson2HashMapperUnitTests() { - super(new Jackson2HashMapper(true)); - } - } - - public static class NonFlatteningJackson2HashMapperUnitTests extends Jackson2HashMapperUnitTests { - - NonFlatteningJackson2HashMapperUnitTests() { - super(new Jackson2HashMapper(false)); - } - } - @Override @SuppressWarnings("rawtypes") protected HashMapper mapperFor(Class t) { diff --git a/src/test/java/org/springframework/data/redis/mapping/NonFlatteningJackson2HashMapperUnitTests.java b/src/test/java/org/springframework/data/redis/mapping/NonFlatteningJackson2HashMapperUnitTests.java new file mode 100644 index 000000000..96e67c6b5 --- /dev/null +++ b/src/test/java/org/springframework/data/redis/mapping/NonFlatteningJackson2HashMapperUnitTests.java @@ -0,0 +1,28 @@ +/* + * Copyright 2022 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.redis.mapping; + +import org.springframework.data.redis.hash.Jackson2HashMapper; + +/** + * @author Mark Paluch + */ +public class NonFlatteningJackson2HashMapperUnitTests extends Jackson2HashMapperUnitTests { + + NonFlatteningJackson2HashMapperUnitTests() { + super(new Jackson2HashMapper(false)); + } +}