### Question:
MySqlDefaultChanger implements DebugSection { @PostConstruct void setMySqlField() { this.mySql = castToTypeOrNull(unwrapSourceFromCacheDataSource(this.dataSource), MySQL.class); }  @Override String getName(); @Override String getDescription(); @Override PermissionNode getRequiredPermission(); @Override void execute(CommandSender sender, List<String> arguments);  }### Answer:
@Test public void shouldSetMySqlFieldOnInitialization() { MySQL mySql = mock(MySQL.class); MySqlDefaultChanger defaultChanger = createDefaultChanger(mySql); defaultChanger.setMySqlField(); assertThat(ReflectionTestUtils.getFieldValue(MySqlDefaultChanger.class, defaultChanger, "mySql"), sameInstance(mySql)); }
@Test public void shouldLeaveMySqlFieldToNullOnInitialization() { DataSource dataSource = mock(DataSource.class); PlayerCache playerCache = mock(PlayerCache.class); CacheDataSource cacheDataSource = new CacheDataSource(dataSource, playerCache); MySqlDefaultChanger defaultChanger = createDefaultChanger(cacheDataSource); defaultChanger.setMySqlField(); assertThat(ReflectionTestUtils.getFieldValue(MySqlDefaultChanger.class, defaultChanger, "mySql"), nullValue()); }