PLCApplicationResources { public int getIntResource(String resourceName) { String value = getStringResource(resourceName); Integer i = 0; try { i = NumberUtils.createInteger(value); } catch (NumberFormatException e) { LOG.error("Error converting " + value + " to int."); } return i; } @Inject  PLCApplicationResources(ResourceBundle resourceBundle); String getStringResource(String resourceName); int getIntResource(String resourceName);  }
@Test public void getIntResource() { PLCApplicationResources resources = TestApplicationResourcesFactory.getApplicationResources(); assertEquals(-20, resources.getIntResource("file.storage.duration")); assertEquals(0, resources.getIntResource("file.storage.duration.invalid")); }