11package jadx .cli ;
22
3- import java .nio .file .Path ;
4-
53import org .assertj .core .api .Condition ;
64import org .junit .jupiter .api .Test ;
75
@@ -14,7 +12,7 @@ public void testBasicExport() throws Exception {
1412 int result = execJadxCli ("samples/small.apk" );
1513 assertThat (result ).isEqualTo (0 );
1614 assertThat (collectAllFilesInDir (outputDir ))
17- .map (Path :: toString )
15+ .map (this :: pathToUniformString )
1816 .haveExactly (2 , new Condition <>(f -> f .startsWith ("sources/" ) && f .endsWith (".java" ), "sources" ))
1917 .haveExactly (10 , new Condition <>(f -> f .startsWith ("resources/" ), "resources" ))
2018 .haveExactly (1 , new Condition <>(f -> f .equals ("resources/AndroidManifest.xml" ), "manifest" ))
@@ -27,7 +25,7 @@ public void testGradleExportApk() throws Exception {
2725 assertThat (result ).isEqualTo (0 );
2826 assertThat (collectAllFilesInDir (outputDir ))
2927 .describedAs ("check output files" )
30- .map (Path :: toString )
28+ .map (this :: pathToUniformString )
3129 .haveExactly (2 , new Condition <>(f -> f .endsWith (".java" ), "java classes" ))
3230 .haveExactly (0 , new Condition <>(f -> f .endsWith ("classes.dex" ), "dex files" ))
3331 .hasSize (15 );
@@ -40,7 +38,7 @@ public void testGradleExportAAR() throws Exception {
4038 assertThat (collectAllFilesInDir (outputDir ))
4139 .describedAs ("check output files" )
4240 .map (this ::printFileContent )
43- .map (Path :: toString )
41+ .map (this :: pathToUniformString )
4442 .haveExactly (1 , new Condition <>(f -> f .startsWith ("lib/src/main/java/" ) && f .endsWith (".java" ), "java" ))
4543 .haveExactly (0 , new Condition <>(f -> f .endsWith (".jar" ), "jar files" ))
4644 .hasSize (8 );
@@ -53,7 +51,7 @@ public void testGradleExportSimpleJava() throws Exception {
5351 assertThat (collectAllFilesInDir (outputDir ))
5452 .describedAs ("check output files" )
5553 .map (this ::printFileContent )
56- .map (Path :: toString )
54+ .map (this :: pathToUniformString )
5755 .haveExactly (1 , new Condition <>(f -> f .endsWith (".java" ) && f .startsWith ("app/src/main/java/" ), "java" ))
5856 .haveExactly (0 , new Condition <>(f -> f .endsWith (".class" ), "class files" ))
5957 .haveExactly (1 , new Condition <>(f -> f .equals ("settings.gradle.kts" ), "settings" ))
@@ -69,7 +67,7 @@ public void testGradleExportInvalidType() throws Exception {
6967 assertThat (collectAllFilesInDir (outputDir ))
7068 .describedAs ("check output files" )
7169 .map (this ::printFileContent )
72- .map (Path :: toString )
70+ .map (this :: pathToUniformString )
7371 .haveExactly (1 , new Condition <>(f -> f .endsWith (".java" ) && f .startsWith ("app/src/main/java/" ), "java" ))
7472 .haveExactly (1 , new Condition <>(f -> f .equals ("settings.gradle" ), "settings" ))
7573 .haveExactly (1 , new Condition <>(f -> f .equals ("build.gradle" ), "build" ))
0 commit comments