-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAppInfoLegacyTest.java
More file actions
36 lines (27 loc) · 1.27 KB
/
AppInfoLegacyTest.java
File metadata and controls
36 lines (27 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.codejive.jpm.config;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
/** Tests for AppInfo class, focusing on action parsing and management. */
class AppInfoLegacyTest {
@TempDir Path tempDir;
@Test
void testUpdateLegacyDeps() throws IOException {
// Create a test app.yml file with legacy dependencies map
Path appYmlPath = tempDir.resolve("app.yml");
String yamlContent = "dependencies:\n" + " com.example:test-lib: \"1.0.0\"\n";
Files.writeString(appYmlPath, yamlContent);
AppInfo appInfo = AppInfo.read(appYmlPath);
// Test dependencies are still parsed correctly
assertThat(appInfo.dependencies()).hasSize(1);
assertThat(appInfo.dependencies()).contains("com.example:test-lib:1.0.0");
AppInfo.write(appInfo, appYmlPath);
// Verify the file now uses new dependencies list format
String updatedContent = Files.readString(appYmlPath);
assertThat(updatedContent).doesNotContain("com.example:test-lib: \"1.0.0\"");
assertThat(updatedContent).contains("- com.example:test-lib:1.0.0");
}
}