If you use Spring you can annotate JUnit test with @ContextConfiguration passing some context.xml configuration, where you can also specify String properties.
For this you have to add dependency on String Test (org.springframework:spring-test) and use it similar to this example (in Groovy):
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = ['/config/dao-context.xml'])
class ClientServiceImplTest {
...
}
UPDATE:
You can add following bean to your context.xml, to load properties from some .properties file
// context.xml
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="location" value="file:test\resources\config\server.properties"/>
</bean>
<context:component-scan base-package="your.package" />
// Java code using property - autowired value by Spring
@Value("${server.dataPassword}")
private String dataPassword;
// server.properties
server.dataPassword=pwd