// Path: src/main/java/uk/sky/cqlmigrate/ChecksumCalculator.java
// static String calculateChecksum(Path path) {
//     try {
//         final MessageDigest digest = MessageDigest.getInstance("SHA-1");
//         final byte[] hash = digest.digest(Files.readAllBytes(path));
//         return bytesToHex(hash);
//     } catch (IOException | NoSuchAlgorithmException e) {
//         throw new RuntimeException(e);
//     }
// }


import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.assertj.core.api.Assertions.assertThat;
import static uk.sky.cqlmigrate.ChecksumCalculator.calculateChecksum;
package uk.sky.cqlmigrate;




public class ChecksumCalculatorTest {

    @Test
    public void calculateChecksumThrowsWhenFileDoesNotExist() throws Exception {
        // given
        Path path = Paths.get("/non-existant-file.cql");

        // When
// Path: src/main/java/uk/sky/cqlmigrate/ChecksumCalculator.java
// static String calculateChecksum(Path path) {
//     try {
//         final MessageDigest digest = MessageDigest.getInstance("SHA-1");
//         final byte[] hash = digest.digest(Files.readAllBytes(path));
//         return bytesToHex(hash);
//     } catch (IOException | NoSuchAlgorithmException e) {
//         throw new RuntimeException(e);
//     }
// }


// Path: src/test/java/uk/sky/cqlmigrate/ChecksumCalculatorTest.java
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.assertj.core.api.Assertions.assertThat;
import static uk.sky.cqlmigrate.ChecksumCalculator.calculateChecksum;

package uk.sky.cqlmigrate;




public class ChecksumCalculatorTest {

    @Test
    public void calculateChecksumThrowsWhenFileDoesNotExist() throws Exception {
        // given
        Path path = Paths.get("/non-existant-file.cql");

        // When
        RuntimeException runtimeException = Assertions.catchThrowableOfType(() -> calculateChecksum(path), RuntimeException.class);