Giter Site home page Giter Site logo

Comments (4)

sbrannen avatar sbrannen commented on June 9, 2024

When declaring a @TestBean varible I have to use the bean name declared in Config, not so flexible.

Have you seen the name attribute in @TestBean that allows you to specify the name of the bean to override?

from spring-framework.

snicoll avatar snicoll commented on June 9, 2024

Hope overriding by type is in a higher priority.

TestBean really works on a bean identified by name, it doesn't do anything by type. I am a bit confused by the report as the annotation has a name attribute that you can't have overlooked. Are we missing something?

from spring-framework.

hantsy avatar hantsy commented on June 9, 2024

When declaring a @TestBean varible I have to use the bean name declared in Config, not so flexible.

Have you seen the name attribute in @TestBean that allows you to specify the name of the bean to override?

yes, I have tried it. When set a name to the bean name, I can rename the variable name to others.

But several years ago when switch to Java Config instead of xml config, as a developer, I would like use type matching as first class citizen for the injecting/mocking everywhere.

from spring-framework.

snicoll avatar snicoll commented on June 9, 2024

yes, I have tried it. When set a name to the bean name, I can rename the variable name to others.

What's up with the issue title then? It really is confusing. And a duplicate of #32761 that I've requalified accordingly.

from spring-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.