@@ -44,13 +44,16 @@ void round_trips_module_and_file_data_without_serializing_input_files() {
4444 var bean = new BeanDefinitionHolder .InputFileData ("bean" , "example.Bean" , BeanDefinitionKind .STEREOTYPE , "example" , new TextSpan (1 , 0 , 1 , 4 ),
4545 false , ProfileExpression .UNCONDITIONAL , null , Map .of (), Set .of ("example.Bean" ));
4646 var model = new SpringContextGatheringModel ();
47+ model .enable ();
4748 model .collectBeans ("module-a" , "file-a" , INPUT_FILE , List .of (bean ));
4849 model .collectPackages ("module-a" , "file-a" , INPUT_FILE , Set .of ("example" ));
4950 model .collectBeans ("module-a" , "file-b" , INPUT_FILE , List .of ());
5051 model .collectPackages ("module-b" , "file-c" , INPUT_FILE , Set .of ("other" ));
5152
5253 String json = GSON .toJson (model );
5354
55+ assertThat (JsonParser .parseString (json ).getAsJsonObject ().keySet ()).containsExactly ("filesData" );
56+
5457 var filesData = JsonParser .parseString (json ).getAsJsonObject ().getAsJsonObject ("filesData" );
5558 assertThat (filesData .keySet ()).containsExactlyInAnyOrder ("module-a" , "module-b" );
5659 var file = filesData .getAsJsonObject ("module-a" ).getAsJsonObject ("file-a" );
@@ -59,6 +62,7 @@ void round_trips_module_and_file_data_without_serializing_input_files() {
5962 assertThat (file .getAsJsonArray ("packages" ).get (0 ).getAsString ()).isEqualTo ("example" );
6063
6164 var restored = GSON .fromJson (json , SpringContextGatheringModel .class );
65+ assertThat (restored .isEnabled ()).isFalse ();
6266 assertThat (restored .filesData ().get ("module-a" )).containsOnlyKeys ("file-a" , "file-b" );
6367 assertThat (restored .filesData ().get ("module-b" )).containsOnlyKeys ("file-c" );
6468 assertThat (restored .filesData ().get ("module-a" ).get ("file-a" ).beans ()).containsExactly (bean );
0 commit comments