Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.palantir.crypto2.cipher;

import static org.junit.Assert.fail;
import static org.assertj.core.api.Assertions.fail;

import com.palantir.crypto2.io.DecryptingSeekableInput;
import com.palantir.crypto2.keys.KeyMaterial;
Expand Down Expand Up @@ -50,7 +50,7 @@ public void close() throws IOException {}
@Override
public void seek(long offset) throws IOException {
if (offset < pos) {
fail();
fail("fail");
}
pos = offset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public DecryptionTests(TestCase testCase) {

@Test
public void testDecrypt() throws IOException {
assertThat(cis.getPos()).isEqualTo(0);
assertThat(cis.getPos()).isZero();

byte[] decrypted = new byte[NUM_BYTES];
readFully(cis, decrypted);
Expand Down Expand Up @@ -143,7 +143,7 @@ private void testSeek(int seekPos) throws IOException {

byte[] expected = Arrays.copyOfRange(data, seekPos, NUM_BYTES);

assertThat(decrypted.length).isEqualTo(expected.length);
assertThat(decrypted).hasSize(expected.length);
assertThat(decrypted).isEqualTo(expected);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void testGenerateKey() {
@Test
public void testGenerateIv() {
byte[] iv = KeyMaterials.generateIv(IV_SIZE);
assertThat(iv.length).isEqualTo(IV_SIZE);
assertThat(iv).hasSize(IV_SIZE);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.Assert.assertTrue;

import com.google.common.io.ByteStreams;
import java.io.File;
Expand Down Expand Up @@ -234,7 +233,7 @@ public void testOnlyPublicKey() throws IOException {
assertThat(readData).isNotEqualTo(dataBytes);

// KeyMaterial file exists
assertTrue(rawFs.exists(keyMaterialPath(path)));
assertThat(rawFs.exists(keyMaterialPath(path))).isTrue();

// Unable to open files without Private Key
assertThatExceptionOfType(IllegalArgumentException.class)
Expand Down Expand Up @@ -288,7 +287,7 @@ public void testListStatus_keyMaterialFilesFiltered() throws IOException {
FileStatus[] fileStatuses = efs.listStatus(path.getParent());
FileStatus expectedStatus = fileStatus[0];

assertThat(fileStatus.length).isEqualTo(1);
assertThat(fileStatus).hasSize(1);
assertThat(fileStatuses).containsExactly(expectedStatus);
}

Expand Down