title: How to test only the "key" from .properties file in java using Junit
body: <p>I have a class ReadPropertyFile which contains method called getPropertyFor which returns a value for the given key as parameter. The getPropertyFor() method I'm calling from other class with key as input parameter. My contents of the properties filetestConfig.properties(file name) are:
  FILE_NAME=D:/Refreshed_data_daily/all_hue_posts_in_excel.xlsx</p>
  
  <pre><code>    public class ReadPropertyFile {
  
  
      private Properties properties;
      public ReadPropertyFile(String propertyFileName) {
  
          properties= new Properties();
          try {
              properties.load(new FileReader(propertyFileName));
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
      public String getPropertyFor(String key) {
          return properties.getProperty(key);
      }
  }
  
  @Test
  public void testFilePathValueInConfigFile(){
      assertEquals(propertyFileObj.getPropertyFor(keyForFilePath), "D:/Refreshed_data_daily/all_hue_posts_in_excel.xlsx");
  }
  </code></pre>
  
  <p>The above test case is to check if the value returned by the function is correct. How do I check if the key is correct? What can be the possible test cases to test the key. And I don't want to change my testConfig.properties file for test purpose.
  I need help , I'm new to Java Junit testing.</p>