Based on what I've read on @Resource annotation, it's DI is by-Name. However, using a bean that's named differently from its setter method (Bean: resourceDependencyTwo vs Setter: resourceDependency) also worked.
Isn't this a contradiction ?
Please check the following:
ResourceDependent da = (ResourceDependent) context.getBean("resourceDependent");
Similar to @Autowired, @Resource may fall back to standard bean type matches (i.e. find a primary type match instead of a specific named bean) as well as resolve well-known "resolvable dependencies": the BeanFactory interface, the ApplicationContext interface, the ResourceLoader interface, the ApplicationEventPublisher interface and the MessageSource interface. Note that this only applies to @Resource usage with no explicit name specified!