File tree Expand file tree Collapse file tree
src/test/java/com/example Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,4 +40,23 @@ public void extendsCorePlugin() {
4040 com .github .pinont .singularitylib .plugin .CorePlugin .class .isAssignableFrom (plugin .getClass ()),
4141 "template should be a CorePlugin" );
4242 }
43+
44+ @ Test
45+ @ DisplayName ("Template writes & loads config.yml on first boot (CorePlugin lifecycle)" )
46+ public void configCreated () {
47+ // CorePlugin.onEnable creates config.yml with a default 'debug' key on first load
48+ java .io .File configFile = new java .io .File (plugin .getDataFolder (), "config.yml" );
49+ Assertions .assertTrue (configFile .exists (), "config.yml created on enable" );
50+ var cfg = plugin .getConfig ();
51+ Assertions .assertNotNull (cfg , "config loaded" );
52+ Assertions .assertFalse (cfg .getBoolean ("debug" , true ), "debug defaults to false" );
53+ }
54+
55+ @ Test
56+ @ DisplayName ("Template registers itself in the lib PluginRegistry" )
57+ public void registersInPluginRegistry () {
58+ Assertions .assertTrue (
59+ com .github .pinont .singularitylib .api .registry .PluginRegistry .find ("SingularityPlugin" ).isPresent (),
60+ "template discovered via lib registry" );
61+ }
4362}
You can’t perform that action at this time.
0 commit comments