### Question:
JdbcReportDataSourceServiceFactory implements ReportDataSourceServiceFactory { public ReportDataSourceService createService(ReportDataSource reportDataSource) { if (!(reportDataSource instanceof JdbcReportDataSource)) { throw new JSException("jsexception.invalid.jdbc.datasource", new Object[] {reportDataSource.getClass()}); } JdbcReportDataSource jdbcDataSource = updateJdbcReportDataSource((JdbcReportDataSource) reportDataSource); DataSource dataSource = getPoolDataSource(jdbcDataSource.getDriverClass(), jdbcDataSource.getConnectionUrl(), jdbcDataSource.getUsername(), jdbcDataSource.getPassword()); return getDataDataServiceInstance(dataSource, getTimeZoneByDataSourceTimeZone(jdbcDataSource.getTimezone())); } JdbcReportDataSourceServiceFactory(); ReportDataSourceService createService(ReportDataSource reportDataSource); PooledJdbcDataSourceFactory getPooledJdbcDataSourceFactory(); void setPooledJdbcDataSourceFactory(
			PooledJdbcDataSourceFactory jdbcDataSourceFactory); int getPoolTimeout(); void setPoolTimeout(int poolTimeout); boolean getDefaultReadOnly(); void setDefaultReadOnly(boolean defaultReadOnly); boolean getDefaultAutoCommit(); void setDefaultAutoCommit(boolean defaultAutoCommit); Set<String> getAutoCommitUnsupportedDrivers(); void setAutoCommitUnsupportedDrivers(Set<String> autoCommitUnsupportedDrivers); Map<String, String> getDriverAuthMethMap(); void setDriverAuthMethMap(Map<String, String> driverAuthMethMap); Map<String, String> getDriverNoAuthMethMap(); void setDriverNoAuthMethMap(Map<String, String> driverNoAuthMethMap); ProfileAttributesResolver getProfileAttributesResolver(); void setProfileAttributesResolver(ProfileAttributesResolver profileAttributesResolver);  }### Answer:
@Test public void ensureDataSourceTimeZoneIsAppliedToDataSourceService() { final String dsTimeZone = "GMT+5"; setUp(); JdbcDataSourceService rds = (JdbcDataSourceService)jdbcReportDataSourceServiceFactory.createService(getDataSourceService(dsTimeZone)); Map<String, ?> paramsMap = new HashMap<>(); rds.setReportParameterValues(paramsMap); assertEquals(TimeZone.getTimeZone(dsTimeZone), paramsMap.get(JRTimezoneJdbcQueryExecuterFactory.PARAMETER_TIMEZONE)); }
@Test public void ensureDefaultTimeZoneIsAppliedToDataSourceServiceIfTZFromDataSourceIsEmptyOrNull() { final String emptyTZ = ""; final String nullTZ = null; setUp(); JdbcDataSourceService emptyTZService = (JdbcDataSourceService)jdbcReportDataSourceServiceFactory.createService(getDataSourceService(emptyTZ)); JdbcDataSourceService nullTZService = (JdbcDataSourceService)jdbcReportDataSourceServiceFactory.createService(getDataSourceService(nullTZ)); Map<String, ?> paramsMap = new HashMap<>(); emptyTZService.setReportParameterValues(paramsMap); assertEquals(TimeZone.getDefault(), paramsMap.get(JRTimezoneJdbcQueryExecuterFactory.PARAMETER_TIMEZONE)); nullTZService.setReportParameterValues(paramsMap); assertEquals(TimeZone.getDefault(), paramsMap.get(JRTimezoneJdbcQueryExecuterFactory.PARAMETER_TIMEZONE)); }