Skip to content

Instantly share code, notes, and snippets.

@nschlimm
Created August 5, 2011 16:08
Show Gist options
  • Save nschlimm/1127873 to your computer and use it in GitHub Desktop.
Save nschlimm/1127873 to your computer and use it in GitHub Desktop.
Decorator example 5
package com.mycompany.springapp.springcdi;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration("/test-decorator-context.xml")
@RunWith(SpringJUnit4ClassRunner.class)
public class DecoratorTestCase {
// This injected bean will be a decorated MyServiceImpl
@Autowired
private MyService service;
@Test
public void testHelloWorld() {
Assert.assertTrue(service.sayHello().equals("Hello"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment