Skip to content

Commit face115

Browse files
authored
feat(core): single registerSingleton to avoid duplication #17
1 parent 6737d0e commit face115

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/digital/pragmatech/testing/diagnostic/ContextDiagnosticApplicationInitializer.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,16 @@ public void initialize(ConfigurableApplicationContext applicationContext) {
3030
}
3131
});
3232
}
33+
34+
@Override
35+
public boolean equals(Object that) {
36+
// avoid double registration of the same bean when listener was discovered via
37+
// spring.factories
38+
return getClass() == that.getClass();
39+
}
40+
41+
@Override
42+
public int hashCode() {
43+
return 0;
44+
}
3345
}

0 commit comments

Comments
 (0)