title: How to mock String value of injected properties file value?
body: <p>I got this member in my service class:</p>
  
  <pre><code>@Value("${dynamodb.aws.region}")
  private String region;
  </code></pre>
  
  <p>When using the class on production, the value in being injected using Spring from my <code>.properties</code> file. </p>
  
  <p>Then, in test mode, I need to check this code:</p>
  
  <pre><code>@Override
  public void init() {
      if (StringUtils.isEmpty(region)){
          String msg = "Connection to DynamoDB couldn't be established. Region value is empty.";
          logger.error(msg);
          throw new IllegalArgumentException(msg);
      }
      this.dynamoDB = new DynamoDB(Regions.fromName(region));
  }
  </code></pre>
  
  <p>Except using getters and setters, What is the best way to inject this value on test ? </p>