@Test public void shouldGetPropertyWithDefaultValue() throws IOException { PowerMockito.mockStatic(IdentityUtil.class); PowerMockito.when(IdentityUtil.class.getResourceAsStream( "/identity.properties")).thenReturn(streamMock); PowerMockito.when(IdentityUtil.getProperty("key", "default")).thenReturn("default"); Assert.assertEquals("default", IdentityUtil.getProperty("key", "default")); }
public static String getProperty(String key) { if (props == null) { try { loadPropertiesFromClasspath(); } catch (Exception ex) { LOG.warn("Unable to load properties file."); return null; } } return props.getProperty(key); }
IdentityUtil { public static String getProperty(String key) { if (props == null) { try { loadPropertiesFromClasspath(); } catch (Exception ex) { LOG.warn("Unable to load properties file."); return null; } } return props.getProperty(key); } }
IdentityUtil { public static String getProperty(String key) { if (props == null) { try { loadPropertiesFromClasspath(); } catch (Exception ex) { LOG.warn("Unable to load properties file."); return null; } } return props.getProperty(key); }  }
IdentityUtil { public static String getProperty(String key) { if (props == null) { try { loadPropertiesFromClasspath(); } catch (Exception ex) { LOG.warn("Unable to load properties file."); return null; } } return props.getProperty(key); }  static String getProperty(String key); static String getProperty(String key, String defaultValue); static int getIntProperty(String key); }
IdentityUtil { public static String getProperty(String key) { if (props == null) { try { loadPropertiesFromClasspath(); } catch (Exception ex) { LOG.warn("Unable to load properties file."); return null; } } return props.getProperty(key); }  static String getProperty(String key); static String getProperty(String key, String defaultValue); static int getIntProperty(String key);  }