From 385ec9fec0dc86c6fb0b8cd1966c29e0f3a40536 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Mon, 13 Sep 2021 21:49:24 +0200 Subject: [PATCH] Implement equals/hashcode in BatchTestContextCustomizer Resolves #3940 --- .../test/context/BatchTestContextCustomizer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/context/BatchTestContextCustomizer.java b/spring-batch-test/src/main/java/org/springframework/batch/test/context/BatchTestContextCustomizer.java index 1fa068193..95e290d67 100644 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/context/BatchTestContextCustomizer.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/context/BatchTestContextCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2021 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. @@ -51,4 +51,14 @@ public class BatchTestContextCustomizer implements ContextCustomizer { new RootBeanDefinition(JobRepositoryTestUtils.class)); } + @Override + public boolean equals(Object obj) { + return obj != null && getClass() == obj.getClass(); + } + + @Override + public int hashCode() { + return getClass().hashCode(); + } + }