Add too weak custom encryption exception (#1119)
* Add too weak custom encryption exception
This commit is contained in:
@@ -35,7 +35,7 @@ public class EncryptionControllerMultiTextEncryptorTests {
|
||||
encrypted, TEXT_PLAIN));
|
||||
}
|
||||
|
||||
@Test(expected = KeyNotInstalledException.class)
|
||||
@Test(expected = EncryptionTooWeakException.class)
|
||||
public void shouldNotEncryptUsingNoOp() {
|
||||
// given
|
||||
String application = "unknown";
|
||||
@@ -46,7 +46,7 @@ public class EncryptionControllerMultiTextEncryptorTests {
|
||||
// then exception is thrown
|
||||
}
|
||||
|
||||
@Test(expected = KeyNotInstalledException.class)
|
||||
@Test(expected = EncryptionTooWeakException.class)
|
||||
public void shouldNotDecryptUsingNoOp() {
|
||||
// given
|
||||
String application = "unknown";
|
||||
|
||||
@@ -45,12 +45,12 @@ public class EncryptionControllerTests {
|
||||
private EncryptionController controller = new EncryptionController(
|
||||
new SingleTextEncryptorLocator(Encryptors.noOpText()));
|
||||
|
||||
@Test(expected = KeyNotInstalledException.class)
|
||||
@Test(expected = EncryptionTooWeakException.class)
|
||||
public void cannotDecryptWithoutKey() {
|
||||
this.controller.decrypt("foo", MediaType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
@Test(expected = KeyNotInstalledException.class)
|
||||
@Test(expected = EncryptionTooWeakException.class)
|
||||
public void cannotDecryptWithNoopEncryptor() {
|
||||
this.controller.decrypt("foo", MediaType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user