Преглед на файлове

Apply suggestions from code review

more renaming

Co-authored-by: Tobias Hagemann <tobias.hagemann@skymatic.de>

Armin Schrenk преди 2 години
родител
ревизия
d9f945e70a

+ 2 - 2
src/main/java/org/cryptomator/ui/convertvault/HubToPasswordConvertController.java

@@ -100,7 +100,7 @@ public class HubToPasswordConvertController implements FxController {
 	@FXML
 	public void convert() {
 		Preconditions.checkState(newPasswordController.isGoodPassword());
-		LOG.info("Converting hub vault {} to local", vault.getPath());
+		LOG.info("Converting hub vault {} to password", vault.getPath());
 		CompletableFuture.runAsync(() -> conversionStarted.setValue(true), Platform::runLater) //
 				.thenRunAsync(this::convertInternal, backgroundExecutorService)
 				.whenCompleteAsync((result, exception) -> {
@@ -121,7 +121,7 @@ public class HubToPasswordConvertController implements FxController {
 			recoveryKeyFactory.newMasterkeyFileWithPassphrase(vault.getPath(), recoveryKey.get(), passphrase);
 			LOG.debug("Successfully created masterkey file for vault {}", vault.getPath());
 			backupHubConfig(vault.getPath().resolve(VAULTCONFIG_FILENAME));
-			replaceWithLocalConfig(passphrase);
+			replaceWithPasswordConfig(passphrase);
 		} catch (MasterkeyLoadingFailedException e) {
 			throw new CompletionException(new IOException("Vault conversion failed", e));
 		} catch (IOException e) {

+ 3 - 3
src/test/java/org/cryptomator/ui/convertvault/HubToPasswordConvertControllerTest.java

@@ -104,7 +104,7 @@ public class HubToPasswordConvertControllerTest {
 			Mockito.when(vaultPath.resolve(anyString())).thenReturn(configPath);
 			Mockito.doNothing().when(recoveryKeyFactory).newMasterkeyFileWithPassphrase(any(), anyString(), any());
 			Mockito.doNothing().when(inSpy).backupHubConfig(any());
-			Mockito.doNothing().when(inSpy).replaceWithLocalConfig(any());
+			Mockito.doNothing().when(inSpy).replaceWithPasswordConfig(any());
 			Mockito.doNothing().when(passphrase).destroy();
 		}
 
@@ -115,13 +115,13 @@ public class HubToPasswordConvertControllerTest {
 
 			Mockito.verify(recoveryKeyFactory, times(1)).newMasterkeyFileWithPassphrase(vaultPath, actualRecoveryKey, passphrase);
 			Mockito.verify(inSpy, times(1)).backupHubConfig(configPath);
-			Mockito.verify(inSpy, times(1)).replaceWithLocalConfig(passphrase);
+			Mockito.verify(inSpy, times(1)).replaceWithPasswordConfig(passphrase);
 			Mockito.verify(passphrase, times(1)).destroy();
 		}
 
 		@Test
 		public void testConvertInternalWrapsCryptoException() throws IOException {
-			Mockito.doThrow(new MasterkeyLoadingFailedException("yadda")).when(inSpy).replaceWithLocalConfig(any());
+			Mockito.doThrow(new MasterkeyLoadingFailedException("yadda")).when(inSpy).replaceWithPasswordConfig(any());
 
 			Assertions.assertThrows(CompletionException.class, inSpy::convertInternal);