@@ -20,7 +20,7 @@ void testReadAppInfoWithActions() throws IOException {
2020 Path appYmlPath = tempDir .resolve ("app.yml" );
2121 String yamlContent =
2222 "dependencies:\n "
23- + " com.example:test-lib: \" 1.0.0\" \n "
23+ + " - com.example:test-lib:1.0.0\n "
2424 + "\n "
2525 + "actions:\n "
2626 + " build: \" javac -cp {{deps}} *.java\" \n "
@@ -51,8 +51,8 @@ void testReadAppInfoWithActions() throws IOException {
5151 assertThat (appInfo .getAction ("nonexistent" )).isNull ();
5252
5353 // Test dependencies are still parsed correctly
54- assertThat (appInfo .dependencies ).hasSize (1 );
55- assertThat (appInfo .dependencies ). containsEntry ("com.example:test-lib" , " 1.0.0" );
54+ assertThat (appInfo .dependencies () ).hasSize (1 );
55+ assertThat (appInfo .dependencies ()). contains ("com.example:test-lib: 1.0.0" );
5656 } finally {
5757 System .setProperty ("user.dir" , originalDir );
5858 }
@@ -62,7 +62,7 @@ void testReadAppInfoWithActions() throws IOException {
6262 void testReadAppInfoWithoutActions () throws IOException {
6363 // Create a test app.yml file without actions
6464 Path appYmlPath = tempDir .resolve ("app.yml" );
65- String yamlContent = "dependencies:\n " + " com.example:test-lib: \" 1.0.0\" \n " ;
65+ String yamlContent = "dependencies:\n " + " - com.example:test-lib:1.0.0\n " ;
6666 Files .writeString (appYmlPath , yamlContent );
6767
6868 String originalDir = System .getProperty ("user.dir" );
@@ -76,7 +76,7 @@ void testReadAppInfoWithoutActions() throws IOException {
7676 assertThat (appInfo .getAction ("build" )).isNull ();
7777
7878 // Test dependencies are still parsed correctly
79- assertThat (appInfo .dependencies ).hasSize (1 );
79+ assertThat (appInfo .dependencies () ).hasSize (1 );
8080 } finally {
8181 System .setProperty ("user.dir" , originalDir );
8282 }
@@ -93,7 +93,7 @@ void testReadEmptyAppInfo() throws IOException {
9393
9494 // Test no actions and no dependencies
9595 assertThat (appInfo .getActionNames ()).isEmpty ();
96- assertThat (appInfo .dependencies ).isEmpty ();
96+ assertThat (appInfo .dependencies () ).isEmpty ();
9797 assertThat (appInfo .getAction ("build" )).isNull ();
9898 } finally {
9999 System .setProperty ("user.dir" , originalDir );
@@ -103,9 +103,9 @@ void testReadEmptyAppInfo() throws IOException {
103103 @ Test
104104 void testWriteAppInfoWithActions () throws IOException {
105105 AppInfo appInfo = new AppInfo ();
106- appInfo .dependencies . put ("com.example:test-lib" , " 1.0.0" );
107- appInfo .actions .put ("build" , "javac -cp {{deps}} *.java" );
108- appInfo .actions .put ("test" , "java -cp {{deps}} TestRunner" );
106+ appInfo .dependencies (). add ("com.example:test-lib: 1.0.0" );
107+ appInfo .actions () .put ("build" , "javac -cp {{deps}} *.java" );
108+ appInfo .actions () .put ("test" , "java -cp {{deps}} TestRunner" );
109109
110110 String originalDir = System .getProperty ("user.dir" );
111111 System .setProperty ("user.dir" , tempDir .toString ());
@@ -122,7 +122,7 @@ void testWriteAppInfoWithActions() throws IOException {
122122 assertThat (readBack .getAction ("build" )).isEqualTo ("javac -cp {{deps}} *.java" );
123123 assertThat (readBack .getAction ("test" )).isEqualTo ("java -cp {{deps}} TestRunner" );
124124 assertThat (readBack .getActionNames ()).hasSize (2 );
125- assertThat (readBack .dependencies ).hasSize (1 );
125+ assertThat (readBack .dependencies () ).hasSize (1 );
126126 } finally {
127127 System .setProperty ("user.dir" , originalDir );
128128 }
@@ -133,7 +133,7 @@ void testAppInfoWithComplexActions() throws IOException {
133133 Path appYmlPath = tempDir .resolve ("app.yml" );
134134 String yamlContent =
135135 "dependencies:\n "
136- + " com.example:test-lib: \" 1.0.0\" \n "
136+ + " - com.example:test-lib:1.0.0\n "
137137 + "\n "
138138 + "actions:\n "
139139 + " complex: \" java -cp {{deps}} -Dprop=value MainClass arg1 arg2\" \n "
@@ -166,7 +166,7 @@ void testReadAppInfoWithRepositories() throws IOException {
166166 Path appYmlPath = tempDir .resolve ("app.yml" );
167167 String yamlContent =
168168 "dependencies:\n "
169- + " com.example:test-lib: \" 1.0.0\" \n "
169+ + " - com.example:test-lib:1.0.0\n "
170170 + "\n "
171171 + "repositories:\n "
172172 + " central: \" https://repo1.maven.org/maven2\" \n "
@@ -181,15 +181,15 @@ void testReadAppInfoWithRepositories() throws IOException {
181181 AppInfo appInfo = AppInfo .read ();
182182
183183 // Test repository retrieval
184- assertThat (appInfo .repositories ).hasSize (3 );
185- assertThat (appInfo .repositories )
184+ assertThat (appInfo .repositories () ).hasSize (3 );
185+ assertThat (appInfo .repositories () )
186186 .containsEntry ("central" , "https://repo1.maven.org/maven2" )
187187 .containsEntry ("jcenter" , "https://jcenter.bintray.com" )
188188 .containsEntry ("custom" , "https://my.custom.repo/maven2" );
189189
190190 // Test dependencies are still parsed correctly
191- assertThat (appInfo .dependencies ).hasSize (1 );
192- assertThat (appInfo .dependencies ). containsEntry ("com.example:test-lib" , " 1.0.0" );
191+ assertThat (appInfo .dependencies () ).hasSize (1 );
192+ assertThat (appInfo .dependencies ()). contains ("com.example:test-lib: 1.0.0" );
193193 } finally {
194194 System .setProperty ("user.dir" , originalDir );
195195 }
@@ -199,7 +199,7 @@ void testReadAppInfoWithRepositories() throws IOException {
199199 void testReadAppInfoWithoutRepositories () throws IOException {
200200 // Create a test app.yml file without repositories
201201 Path appYmlPath = tempDir .resolve ("app.yml" );
202- String yamlContent = "dependencies:\n " + " com.example:test-lib: \" 1.0.0\" \n " ;
202+ String yamlContent = "dependencies:\n " + " - com.example:test-lib:1.0.0\n " ;
203203 Files .writeString (appYmlPath , yamlContent );
204204
205205 String originalDir = System .getProperty ("user.dir" );
@@ -209,10 +209,10 @@ void testReadAppInfoWithoutRepositories() throws IOException {
209209 AppInfo appInfo = AppInfo .read ();
210210
211211 // Test no repositories
212- assertThat (appInfo .repositories ).isEmpty ();
212+ assertThat (appInfo .repositories () ).isEmpty ();
213213
214214 // Test dependencies are still parsed correctly
215- assertThat (appInfo .dependencies ).hasSize (1 );
215+ assertThat (appInfo .dependencies () ).hasSize (1 );
216216 } finally {
217217 System .setProperty ("user.dir" , originalDir );
218218 }
@@ -221,9 +221,9 @@ void testReadAppInfoWithoutRepositories() throws IOException {
221221 @ Test
222222 void testWriteAppInfoWithRepositories () throws IOException {
223223 AppInfo appInfo = new AppInfo ();
224- appInfo .dependencies . put ("com.example:test-lib" , " 1.0.0" );
225- appInfo .repositories .put ("central" , "https://repo1.maven.org/maven2" );
226- appInfo .repositories .put ("custom" , "https://my.custom.repo/maven2" );
224+ appInfo .dependencies (). add ("com.example:test-lib: 1.0.0" );
225+ appInfo .repositories () .put ("central" , "https://repo1.maven.org/maven2" );
226+ appInfo .repositories () .put ("custom" , "https://my.custom.repo/maven2" );
227227
228228 String originalDir = System .getProperty ("user.dir" );
229229 System .setProperty ("user.dir" , tempDir .toString ());
@@ -237,11 +237,11 @@ void testWriteAppInfoWithRepositories() throws IOException {
237237
238238 // Read it back and verify
239239 AppInfo readBack = AppInfo .read ();
240- assertThat (readBack .repositories ).hasSize (2 );
241- assertThat (readBack .repositories )
240+ assertThat (readBack .repositories () ).hasSize (2 );
241+ assertThat (readBack .repositories () )
242242 .containsEntry ("central" , "https://repo1.maven.org/maven2" )
243243 .containsEntry ("custom" , "https://my.custom.repo/maven2" );
244- assertThat (readBack .dependencies ).hasSize (1 );
244+ assertThat (readBack .dependencies () ).hasSize (1 );
245245 } finally {
246246 System .setProperty ("user.dir" , originalDir );
247247 }
@@ -250,7 +250,7 @@ void testWriteAppInfoWithRepositories() throws IOException {
250250 @ Test
251251 void testWriteAppInfoWithoutRepositories () throws IOException {
252252 AppInfo appInfo = new AppInfo ();
253- appInfo .dependencies . put ("com.example:test-lib" , " 1.0.0" );
253+ appInfo .dependencies (). add ("com.example:test-lib: 1.0.0" );
254254 // No repositories added
255255
256256 String originalDir = System .getProperty ("user.dir" );
@@ -261,8 +261,8 @@ void testWriteAppInfoWithoutRepositories() throws IOException {
261261
262262 // Read it back and verify repositories section is not present
263263 AppInfo readBack = AppInfo .read ();
264- assertThat (readBack .repositories ).isEmpty ();
265- assertThat (readBack .dependencies ).hasSize (1 );
264+ assertThat (readBack .repositories () ).isEmpty ();
265+ assertThat (readBack .dependencies () ).hasSize (1 );
266266
267267 // Also verify the YAML content doesn't contain repositories section
268268 String content = Files .readString (tempDir .resolve ("app.yml" ));
@@ -277,7 +277,7 @@ void testAppInfoWithComplexRepositoriesAndActions() throws IOException {
277277 Path appYmlPath = tempDir .resolve ("app.yml" );
278278 String yamlContent =
279279 "dependencies:\n "
280- + " com.example:test-lib: \" 1.0.0\" \n "
280+ + " - com.example:test-lib:1.0.0\n "
281281 + "\n "
282282 + "repositories:\n "
283283 + " central: \" https://repo1.maven.org/maven2\" \n "
@@ -294,11 +294,11 @@ void testAppInfoWithComplexRepositoriesAndActions() throws IOException {
294294 AppInfo appInfo = AppInfo .read ();
295295
296296 // Test all sections are parsed correctly
297- assertThat (appInfo .dependencies ).hasSize (1 );
298- assertThat (appInfo .repositories ).hasSize (2 );
297+ assertThat (appInfo .dependencies () ).hasSize (1 );
298+ assertThat (appInfo .repositories () ).hasSize (2 );
299299 assertThat (appInfo .getActionNames ()).hasSize (1 );
300300
301- assertThat (appInfo .repositories )
301+ assertThat (appInfo .repositories () )
302302 .containsEntry ("central" , "https://repo1.maven.org/maven2" )
303303 .containsEntry (
304304 "sonatype-snapshots" ,
0 commit comments