/*============LICENSE_START=======================================================
* oom-truststore-merger
* ================================================================================
- * Copyright (C) 2020 Nokia. All rights reserved.
+ * Copyright (C) 2020-2021 Nokia. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-public class KeystoreCopierTest {
+class KeystoreCopierTest {
private static final String SOURCE_CONTENT = "source content";
private static final String DESTINATION_CONTENT = "destination content";
copier.copyKeystores(configuration);
- assertThat(dir.listFiles()).isEmpty();
+ assertThat(dir).isEmptyDirectory();
}
copier.copyKeystores(configuration);
assertThat(readFile(destination)).isEqualTo(readFile(source));
- assertThat(backup.exists()).isTrue();
+ assertThat(backup).exists();
assertThat(readFile(backup)).isEqualTo(DESTINATION_CONTENT);
}
copier.copyKeystores(configuration);
- assertThat(destination.exists()).isTrue();
+ assertThat(destination).exists();
assertThat(readFile(destination)).isEqualTo(readFile(source));
- assertThat(backup.exists()).isFalse();
+ assertThat(backup).doesNotExist();
}
@Test
copier.copyKeystores(configuration)
);
- assertThat(source.exists()).isFalse();
- assertThat(destination.exists()).isFalse();
- assertThat(backup.exists()).isFalse();
+ assertThat(source).doesNotExist();
+ assertThat(destination).doesNotExist();
+ assertThat(backup).doesNotExist();
}
@Test
copier.copyKeystores(configuration)
);
- assertThat(source.exists()).isTrue();
- assertThat(destination.exists()).isFalse();
- assertThat(backup.exists()).isFalse();
+ assertThat(source).exists();
+ assertThat(destination).doesNotExist();
+ assertThat(backup).doesNotExist();
}
private AppConfiguration createConfiguration(File source, File destination) {