xxxxxxxxxx
org.springframework.test.util.ReflectionTestUtils.setField(fooTest, "field", "value");
//or
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = FooTest.Config.class)
@TestPropertySource(properties = {
"some.bar.value=testValue",
})
public class FooTest {
..
}