String path = "/incorrect-checksums/1.0/incorrect-checksums-1.0.jar";
File sha1File = new File( repoConfig.getLocation(), path + ".sha1" );
File md5File = new File( repoConfig.getLocation(), path + ".md5" );
ChecksummedFile checksum = new ChecksummedFile( new File( repoConfig.getLocation(), path ) );
assertTrue( sha1File.exists() );
assertTrue( md5File.exists() );
assertFalse( checksum.isValidChecksums( new ChecksumAlgorithm[] { ChecksumAlgorithm.MD5, ChecksumAlgorithm.SHA1 } ) );
consumer.beginScan( repoConfig, Calendar.getInstance().getTime() );
consumer.processFile( path );
assertTrue( sha1File.exists() );
assertTrue( md5File.exists() );
assertTrue( checksum.isValidChecksums( new ChecksumAlgorithm[] { ChecksumAlgorithm.MD5, ChecksumAlgorithm.SHA1 } ) );
}