diff --git a/src/main/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTask.java b/src/main/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTask.java index 09f0818..89cc683 100644 --- a/src/main/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTask.java +++ b/src/main/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTask.java @@ -121,9 +121,10 @@ private SymbolUploadBeginRequest symbolUploadRequest(@Nonnull String pathToApp, @Nonnull private SymbolUploadBeginRequest androidSymbolsUpload(@Nonnull String pathToApp, @Nonnull String pathToDebugSymbols) throws IOException { - final File file = new File(filePath.child(pathToApp).getRemote()); - final AndroidParser androidParser = parserFactory.androidParser(file); - final String fileName = androidParser.fileName(); + final File apkFile = new File(filePath.child(pathToApp).getRemote()); + final File debugSymbolsFile = new File(filePath.child(pathToDebugSymbols).getRemote()); + final AndroidParser androidParser = parserFactory.androidParser(apkFile); + final String fileName = debugSymbolsFile.getName(); final String versionCode = androidParser.versionCode(); final String versionName = androidParser.versionName(); final SymbolTypeEnum symbolType = getAndroidSymbolTypeEnum(pathToDebugSymbols); diff --git a/src/test/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTaskTest.java b/src/test/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTaskTest.java index d39db4c..a5fd145 100644 --- a/src/test/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTaskTest.java +++ b/src/test/java/io/jenkins/plugins/appcenter/task/internal/PrerequisitesTaskTest.java @@ -124,10 +124,9 @@ public void should_ReturnModifiedRequest_When_DebugSymbolsExists_Android() throw given(mockFilePath.child(anyString())).willReturn(mockFilePath); given(mockFilePath.getRemote()).willReturn(pathToDebugSymbols); given(mockParserFactory.androidParser(any(File.class))).willReturn(mockAndroidParser); - given(mockAndroidParser.fileName()).willReturn("app.apk"); given(mockAndroidParser.versionCode()).willReturn("1"); given(mockAndroidParser.versionName()).willReturn("1.0.0"); - final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(AndroidProguard, null, "app.apk", "1", "1.0.0"); + final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(AndroidProguard, null, "mapping.txt", "1", "1.0.0"); final UploadRequest expected = fullUploadRequest.newBuilder() .setPathToApp(pathToApp) .setPathToDebugSymbols(pathToDebugSymbols) @@ -156,10 +155,9 @@ public void should_ReturnModifiedRequest_When_DebugSymbolsExists_Android_Breakpa given(mockFilePath.child(anyString())).willReturn(mockFilePath); given(mockFilePath.getRemote()).willReturn(pathToDebugSymbols); given(mockParserFactory.androidParser(any(File.class))).willReturn(mockAndroidParser); - given(mockAndroidParser.fileName()).willReturn("app.apk"); given(mockAndroidParser.versionCode()).willReturn("1"); given(mockAndroidParser.versionName()).willReturn("1.0.0"); - final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(Breakpad, null, "app.apk", "1", "1.0.0"); + final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(Breakpad, null, "breakpad-symbols.zip", "1", "1.0.0"); final UploadRequest expected = fullUploadRequest.newBuilder() .setPathToApp(pathToApp) .setPathToDebugSymbols(pathToDebugSymbols)