SmartAssetLoader implements GameAssetLoader { @Override public void put(Map<String, Class<?>> assets) { for (Class<?> subclass : target.getDeclaredClasses()) { putMembers(subclass, assets, subclass.getAnnotation(AssetSource.class)); } putMembers(target, assets, target.getAnnotation(AssetSource.class)); } SmartAssetLoader(Class<?> target); @Override void put(Map<String, Class<?>> assets);  }
@Test public void testDefaultTypes() { SmartAssetLoader loader = new SmartAssetLoader(SampleValidAssets.class); loader.put(assets); assertThat(assets).hasSize(12); }
@Test public void testProducesErrors_WithInvalidAssets() { Application application = mock(Application.class); doNothing().when(application).error(anyString(), anyString()); Gdx.app = application; SmartAssetLoader loader = new SmartAssetLoader(SampleInvalidAssets.class); loader.put(assets); assertThat(assets).hasSize(10); verify(application, times(3)).error(anyString(), anyString()); }