@Test public void testGetEnvironmentProperty() { doReturn( VALUE ).when( backend ).getEnvironmentProperty( KEY ); Object result = env.getEnvironmentProperty( KEY ); assertThat( (String) result, is( equalTo( VALUE ) ) ); result = env.getEnvironmentProperty( KEY ); assertThat( (String) result, is( equalTo( VALUE ) ) ); verify( backend ).getEnvironmentProperty( KEY ); }
public Object getEnvironmentProperty( final String key ) { final Object fromCache = properties.get( key ); if ( fromCache != null ) { if ( fromCache != NULLOBJECT ) { return fromCache; } return null; } final Object fromBackend = backend.getEnvironmentProperty( key ); if ( fromBackend == null ) { properties.put( key, NULLOBJECT ); } else { properties.put( key, fromBackend ); } return fromBackend; }
CachingReportEnvironment implements ReportEnvironment { public Object getEnvironmentProperty( final String key ) { final Object fromCache = properties.get( key ); if ( fromCache != null ) { if ( fromCache != NULLOBJECT ) { return fromCache; } return null; } final Object fromBackend = backend.getEnvironmentProperty( key ); if ( fromBackend == null ) { properties.put( key, NULLOBJECT ); } else { properties.put( key, fromBackend ); } return fromBackend; } }
CachingReportEnvironment implements ReportEnvironment { public Object getEnvironmentProperty( final String key ) { final Object fromCache = properties.get( key ); if ( fromCache != null ) { if ( fromCache != NULLOBJECT ) { return fromCache; } return null; } final Object fromBackend = backend.getEnvironmentProperty( key ); if ( fromBackend == null ) { properties.put( key, NULLOBJECT ); } else { properties.put( key, fromBackend ); } return fromBackend; } CachingReportEnvironment( final ReportEnvironment backend ); }
CachingReportEnvironment implements ReportEnvironment { public Object getEnvironmentProperty( final String key ) { final Object fromCache = properties.get( key ); if ( fromCache != null ) { if ( fromCache != NULLOBJECT ) { return fromCache; } return null; } final Object fromBackend = backend.getEnvironmentProperty( key ); if ( fromBackend == null ) { properties.put( key, NULLOBJECT ); } else { properties.put( key, fromBackend ); } return fromBackend; } CachingReportEnvironment( final ReportEnvironment backend ); Object getEnvironmentProperty( final String key ); String getURLEncoding(); Locale getLocale(); TimeZone getTimeZone(); Map<String, String[]> getUrlExtraParameter(); Object clone(); }
CachingReportEnvironment implements ReportEnvironment { public Object getEnvironmentProperty( final String key ) { final Object fromCache = properties.get( key ); if ( fromCache != null ) { if ( fromCache != NULLOBJECT ) { return fromCache; } return null; } final Object fromBackend = backend.getEnvironmentProperty( key ); if ( fromBackend == null ) { properties.put( key, NULLOBJECT ); } else { properties.put( key, fromBackend ); } return fromBackend; } CachingReportEnvironment( final ReportEnvironment backend ); Object getEnvironmentProperty( final String key ); String getURLEncoding(); Locale getLocale(); TimeZone getTimeZone(); Map<String, String[]> getUrlExtraParameter(); Object clone();  }