### Question:
JdbcDriverServiceImpl implements JdbcDriverService, ApplicationContextAware { @Override public synchronized boolean isRegistered(String driverClass) { boolean registered = true; try { this.register(driverClass); } catch (Exception e) { registered = false; } return registered; }  void setRepository(RepositoryService repository); void setSystemClassLoaderFirst(Boolean systemClassLoaderFirst); void setJdbcDriversFolder(String jdbcDriversFolder); String getJdbcDriversFolder(); @Override synchronized void register(String driverClass); @Override synchronized boolean isRegistered(String driverClass); @Override synchronized void setDriverMappings(Map<String, String> driverMappings); synchronized void setDriverMapping(String driverClass, String path); synchronized void removeDriverMapping(String driverClass); @Override Map<String, String> getDriverMappings(); @Override Set<String> getRegisteredDriverClassNames(); @Override synchronized void setDriverMappingAndRegister(String driverClass, String path); @Override @Transactional(propagation = Propagation.REQUIRED) void setDriver(String driverClassName, Map<String, byte[]> driverFiles); @Override void setApplicationContext(ApplicationContext applicationContext); static final String DEFAULT_JDBC_REPO_FOLDER; static final String DEFAULT_JDBC_TEMP_FOLDER; static final String URL_CLASSLOADER_FORMAT; static final String TEMP_FILE_PATH_FORMAT; static final String SYSTEM_PROPERTIES_LIST_KEY_PREFIX; static final String SYSTEM_PROPERTIES_LIST_KEY_FORMAT; static final String SYSTEM_PROPERTIES_PRESERVED_KEY_SUFFIX; static final String SYSTEM_CLASSLOADER_PATH; }### Answer:
@Test public void ifDriverAlsreadyRegisteredItShouldNotBeDoubleRegistered() throws Exception { boolean registered = jdbcDriverService.isRegistered(TEST_DRIVER_CLASS_NAME); assertTrue(registered); registered = jdbcDriverService.isRegistered(TEST_DRIVER_CLASS_NAME); assertTrue(registered); Mockito.verify(propertiesManagementService, Mockito.times(1)).getProperty( ArgumentMatchers.eq(String.format(JdbcDriverServiceImpl.SYSTEM_PROPERTIES_LIST_KEY_FORMAT, TEST_DRIVER_CLASS_NAME))); }
@Test public void isRegisteredShouldNotThrowExceptions() throws Exception { boolean registered = jdbcDriverService.isRegistered(TEST_DRIVER_CLASS_NAME + 1); assertFalse(registered); }