Results 1 to 5 of 5

Thread: How do I enable @Required Annotation in JavaConfig?

Threaded View

  1. #1
    Join Date
    Oct 2008
    Location
    Cambridge, MA
    Posts
    56

    Default How do I enable @Required Annotation in JavaConfig?

    Hello,
    I'm trying to port an existing application to JavaConfig. How do I enable the @Required annotation? In XML, I did so via the <context:annotation-config/> tag. My code is:
    Code:
    @ContextConfiguration(locations = "mypackage.ApplicationConfig", loader = JavaConfigContextLoader.class)
    public class ReplicatedStoreTest extends AbstractTestNGSpringContextTests{
    
    	@Test
    	public void test() {
    		Assert.assertNotNull(config);
    	}
    	
    	@Autowired
    	StartupParameters config;
    }
    It's injecting properly into the config object, but ignoring the @Required in StartupParameters

    Thanks in Advance,
    Steven
    Harvard Children's Hospital Informatics Program
    Last edited by JavaGeek_Boston; Oct 21st, 2008 at 03:14 PM. Reason: testing if validation is shut off now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •