-
Notifications
You must be signed in to change notification settings - Fork 38.4k
@Configuration class is not detected as default in composed annotation in the TestContext framework [SPR-11641] #16264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sam Brannen commented Yes, this is a direct result of #16081. When To make your code work again, please declare your
Regards, Sam |
Sam Brannen commented Resolving this issue as Won't Fix since the effect is intentional. |
Janne Valkealahti commented Problem is that we created a composed annotation MiniYarnClusterTest based on what worked with 4.0.2 and this annotation is part of our hadoop testing framework in spring hadoop. It's purpose was to ease testing without having a need to create dummy empty
Is there any workaround other than again start adding empty |
Janne Valkealahti commented In #16081 you wrote:
Was there something I totally misunderstood about a usage of composed annotations with |
Sam Brannen commented
I have to apologize for the change in a point release, but it was deemed the appropriate solution.
Did you try the change I proposed in my previous comment (i.e., You won't need any empty Regards, Sam |
Sam Brannen commented
No, you understood it correctly. However, we decided that the change in #16081 was necessary based on the following rationale. Without that change it is impossible to create a custom composed annotation that is meta-annotated with As the developer of such a composed annotation, you are not limited by this change: you can still have a default Does that clarify things for you? |
Sam Brannen commented I just read the Javadoc for Why would you make people duplicate your entire composed annotation? That completely defeats the purpose. Instead, you should make the attributes of
Note that the Regards, Sam |
Janne Valkealahti commented Ah, gotcha!!! I first totally misinterpreted what you wrote to that example and then asked if there's a workaround. That is the workaround I was looking for, so sorry for nitpicking it any further. Yes, just tried it and it works for both 4.0.2 and 4.0.3 and stays same from end-user point of view. We'll just make these changes for Spring Hadoop RC2. Thanks! |
Sam Brannen commented Also, the claim in the following Javadoc from
|
Sam Brannen commented
Great! I'm glad to hear it, especially the "stays same from end-user point of view" part since that was my intention. :) |
Janne Valkealahti commented Thanks for clarification for the correct concept if end-user wants/needs to create a custom composed annotation. The example you just posted indeed looks much better. Being honest I didn't even think we could write it like that to allow much easier way to extend it. :) Cheers, |
Sam Brannen commented
You're welcome!
I agree. ;)
Yeah, I fear that most people don't yet know all of the possibilities with composed annotations and meta-annotation attribute overrides. That's why we are making it an important topic for Spring Framework 4.1. See #16136 and its subtasks for details. |
Janne Valkealahti opened SPR-11641 and commented
I have below classes in my tests. This used to work with 4.0.2 but now fails with 4.0.3. I don't know if this is somehow related to work for #16081 and other jira's linked to it.
ComposedAnnotationTests.java
CustomMiniYarnClusterTest
This fails with message:
Affects: 4.0.3
Issue Links:
Referenced from: commits spring-attic/spring-hadoop@0ef5c92
The text was updated successfully, but these errors were encountered: