mirror of
https://github.com/google/nomulus
synced 2026-01-08 07:11:44 +00:00
Fix some low-hanging code quality issue fruits (#1047)
* Fix some low-hanging code quality issue fruits These include problems such as: use of raw types, unnecessary throw clauses, unused variables, and more.
This commit is contained in:
@@ -154,7 +154,7 @@ public abstract class ProtocolModuleTest {
|
||||
new EmbeddedChannel(
|
||||
new ChannelInitializer<Channel>() {
|
||||
@Override
|
||||
protected void initChannel(Channel ch) throws Exception {
|
||||
protected void initChannel(Channel ch) {
|
||||
initializer.accept(ch);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ class BackendMetricsHandlerTest {
|
||||
new EmbeddedChannel(
|
||||
new ChannelInitializer<EmbeddedChannel>() {
|
||||
@Override
|
||||
protected void initChannel(EmbeddedChannel ch) throws Exception {
|
||||
protected void initChannel(EmbeddedChannel ch) {
|
||||
ch.attr(PROTOCOL_KEY).set(backendProtocol);
|
||||
ch.attr(RELAY_CHANNEL_KEY).set(frontendChannel);
|
||||
ch.pipeline().addLast(handler);
|
||||
|
||||
@@ -82,8 +82,8 @@ class EppServiceHandlerTest {
|
||||
|
||||
private EmbeddedChannel channel;
|
||||
|
||||
private void setHandshakeSuccess(EmbeddedChannel channel, X509Certificate certificate)
|
||||
throws Exception {
|
||||
private void setHandshakeSuccess(EmbeddedChannel channel, X509Certificate certificate) {
|
||||
@SuppressWarnings("unused")
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
channel.attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().setSuccess(certificate);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class EppServiceHandlerTest {
|
||||
setHandshakeSuccess(channel, clientCertificate);
|
||||
}
|
||||
|
||||
private void setHandshakeFailure(EmbeddedChannel channel) throws Exception {
|
||||
private void setHandshakeFailure(EmbeddedChannel channel) {
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
channel
|
||||
.attr(CLIENT_CERTIFICATE_PROMISE_KEY)
|
||||
@@ -135,12 +135,12 @@ class EppServiceHandlerTest {
|
||||
channel = setUpNewChannel(eppServiceHandler);
|
||||
}
|
||||
|
||||
private EmbeddedChannel setUpNewChannel(EppServiceHandler handler) throws Exception {
|
||||
private EmbeddedChannel setUpNewChannel(EppServiceHandler handler) {
|
||||
return new EmbeddedChannel(
|
||||
DefaultChannelId.newInstance(),
|
||||
new ChannelInitializer<EmbeddedChannel>() {
|
||||
@Override
|
||||
protected void initChannel(EmbeddedChannel ch) throws Exception {
|
||||
protected void initChannel(EmbeddedChannel ch) {
|
||||
ch.attr(REMOTE_ADDRESS_KEY).set(CLIENT_ADDRESS);
|
||||
ch.attr(CLIENT_CERTIFICATE_PROMISE_KEY).set(ch.eventLoop().newPromise());
|
||||
ch.pipeline().addLast(handler);
|
||||
|
||||
@@ -61,7 +61,7 @@ class FrontendMetricsHandlerTest {
|
||||
new EmbeddedChannel(
|
||||
new ChannelInitializer<EmbeddedChannel>() {
|
||||
@Override
|
||||
protected void initChannel(EmbeddedChannel ch) throws Exception {
|
||||
protected void initChannel(EmbeddedChannel ch) {
|
||||
ch.attr(PROTOCOL_KEY).set(frontendProtocol);
|
||||
ch.attr(CLIENT_CERTIFICATE_HASH_KEY).set(CLIENT_CERT_HASH);
|
||||
ch.pipeline().addLast(handler);
|
||||
|
||||
@@ -67,7 +67,7 @@ class QuotaManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_rebate() throws Exception {
|
||||
void testSuccess_rebate() {
|
||||
DateTime grantedTokenRefillTime = clock.nowUtc();
|
||||
response = QuotaResponse.create(true, USER_ID, grantedTokenRefillTime);
|
||||
QuotaRebate rebate = QuotaRebate.create(response);
|
||||
|
||||
Reference in New Issue
Block a user