mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02:00
Remove more unnecessary "throws" declarations
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201243722
This commit is contained in:
parent
47322b7fcd
commit
ad73f3d167
61 changed files with 318 additions and 331 deletions
|
@ -24,7 +24,6 @@ import google.registry.model.server.KmsSecretRevision;
|
|||
import google.registry.model.server.KmsSecretRevision.Builder;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import java.io.IOException;
|
||||
import org.bouncycastle.openpgp.PGPKeyPair;
|
||||
import org.bouncycastle.openpgp.PGPPrivateKey;
|
||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||
|
@ -112,7 +111,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getRdeSshClientPublicKey() throws Exception {
|
||||
public void test_getRdeSshClientPublicKey() {
|
||||
saveCleartextSecret("rde-ssh-client-public-string");
|
||||
|
||||
String rdeSshClientPublicKey = keyring.getRdeSshClientPublicKey();
|
||||
|
@ -121,7 +120,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getRdeSshClientPrivateKey() throws Exception {
|
||||
public void test_getRdeSshClientPrivateKey() {
|
||||
saveCleartextSecret("rde-ssh-client-private-string");
|
||||
|
||||
String rdeSshClientPrivateKey = keyring.getRdeSshClientPrivateKey();
|
||||
|
@ -130,7 +129,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getIcannReportingPassword() throws Exception {
|
||||
public void test_getIcannReportingPassword() {
|
||||
saveCleartextSecret("icann-reporting-password-string");
|
||||
|
||||
String icannReportingPassword = keyring.getIcannReportingPassword();
|
||||
|
@ -139,7 +138,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbDnlLogin() throws Exception {
|
||||
public void test_getMarksdbDnlLogin() {
|
||||
saveCleartextSecret("marksdb-dnl-login-string");
|
||||
|
||||
String marksdbDnlLogin = keyring.getMarksdbDnlLogin();
|
||||
|
@ -148,7 +147,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbLordnPassword() throws Exception {
|
||||
public void test_getMarksdbLordnPassword() {
|
||||
saveCleartextSecret("marksdb-lordn-password-string");
|
||||
|
||||
String marksdbLordnPassword = keyring.getMarksdbLordnPassword();
|
||||
|
@ -157,7 +156,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbSmdrlLogin() throws Exception {
|
||||
public void test_getMarksdbSmdrlLogin() {
|
||||
saveCleartextSecret("marksdb-smdrl-login-string");
|
||||
|
||||
String marksdbSmdrlLogin = keyring.getMarksdbSmdrlLogin();
|
||||
|
@ -167,7 +166,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getJsonCredential() throws Exception {
|
||||
public void test_getJsonCredential() {
|
||||
saveCleartextSecret("json-credential-string");
|
||||
|
||||
String jsonCredential = keyring.getJsonCredential();
|
||||
|
@ -176,7 +175,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getBraintreePrivateKey() throws Exception {
|
||||
public void test_getBraintreePrivateKey() {
|
||||
saveCleartextSecret("braintree-private-key-string");
|
||||
|
||||
String braintreePrivateKey = keyring.getBraintreePrivateKey();
|
||||
|
@ -184,7 +183,7 @@ public class KmsKeyringTest {
|
|||
assertThat(braintreePrivateKey).isEqualTo("braintree-private-key-stringmoo");
|
||||
}
|
||||
|
||||
private static void persistSecret(String secretName, byte[] secretValue) throws IOException {
|
||||
private static void persistSecret(String secretName, byte[] secretValue) {
|
||||
KmsConnection kmsConnection = new FakeKmsConnection();
|
||||
|
||||
KmsSecretRevision secretRevision =
|
||||
|
@ -197,7 +196,7 @@ public class KmsKeyringTest {
|
|||
persistResources(ImmutableList.of(secretRevision, secret));
|
||||
}
|
||||
|
||||
private static void saveCleartextSecret(String secretName) throws Exception {
|
||||
private static void saveCleartextSecret(String secretName) {
|
||||
persistSecret(secretName, KeySerializer.serializeString(secretName + "moo"));
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMultipleSecrets() throws Exception {
|
||||
public void test_setMultipleSecrets() {
|
||||
updater
|
||||
.setBraintreePrivateKey("value1")
|
||||
.setIcannReportingPassword("value2")
|
||||
|
@ -68,7 +68,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setBraintreePrivateKey() throws Exception {
|
||||
public void test_setBraintreePrivateKey() {
|
||||
updater.setBraintreePrivateKey("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -102,7 +102,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setIcannReportingPassword() throws Exception {
|
||||
public void test_setIcannReportingPassword() {
|
||||
updater.setIcannReportingPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -112,7 +112,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setJsonCredential() throws Exception {
|
||||
public void test_setJsonCredential() {
|
||||
updater.setJsonCredential("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -120,7 +120,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbDnlLogin() throws Exception {
|
||||
public void test_setMarksdbDnlLogin() {
|
||||
updater.setMarksdbDnlLogin("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -128,7 +128,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbLordnPassword() throws Exception {
|
||||
public void test_setMarksdbLordnPassword() {
|
||||
updater.setMarksdbLordnPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -138,7 +138,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbSmdrlLogin() throws Exception {
|
||||
public void test_setMarksdbSmdrlLogin() {
|
||||
updater.setMarksdbSmdrlLogin("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -171,7 +171,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setRdeSshClientPrivateKey() throws Exception {
|
||||
public void test_setRdeSshClientPrivateKey() {
|
||||
updater.setRdeSshClientPrivateKey("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -181,7 +181,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setRdeSshClientPublicKey() throws Exception {
|
||||
public void test_setRdeSshClientPublicKey() {
|
||||
updater.setRdeSshClientPublicKey("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -215,11 +215,11 @@ public class KmsUpdaterTest {
|
|||
assertThat(secretRevision.getEncryptedValue()).isEqualTo(expectedEncryptedValue);
|
||||
}
|
||||
|
||||
private static String getCiphertext(byte[] plaintext) throws IOException {
|
||||
private static String getCiphertext(byte[] plaintext) {
|
||||
return new FakeKmsConnection().encrypt("blah", plaintext).ciphertext();
|
||||
}
|
||||
|
||||
private static String getCiphertext(String plaintext) throws IOException {
|
||||
private static String getCiphertext(String plaintext) {
|
||||
return getCiphertext(KeySerializer.serializeString(plaintext));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue