mirror of
https://github.com/google/nomulus.git
synced 2025-05-17 09:57:17 +02:00
Clean up some code quality issues
This removes some qualifiers that aren't necessary (e.g. public/abstract on interfaces, private on enum constructors, final on private methods, static on nested interfaces/enums), uses Java 8 lambdas and features where that's an improvement ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177182945
This commit is contained in:
parent
0935ba6450
commit
e2db3f914e
109 changed files with 286 additions and 379 deletions
|
@ -21,9 +21,7 @@ import com.google.api.client.http.HttpRequest;
|
|||
import com.google.api.client.http.HttpRequestFactory;
|
||||
import com.google.api.client.http.HttpRequestInitializer;
|
||||
import com.google.common.net.HostAndPort;
|
||||
import google.registry.testing.Providers;
|
||||
import java.io.IOException;
|
||||
import javax.inject.Provider;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -43,8 +41,6 @@ public class DefaultRequestFactoryModuleTest {
|
|||
}
|
||||
});
|
||||
|
||||
Provider<Credential> credentialProvider = Providers.of(FAKE_CREDENTIAL);
|
||||
|
||||
DefaultRequestFactoryModule module = new DefaultRequestFactoryModule();
|
||||
|
||||
@Before
|
||||
|
@ -56,9 +52,9 @@ public class DefaultRequestFactoryModuleTest {
|
|||
public void test_provideHttpRequestFactory_localhost() throws Exception {
|
||||
// Make sure that localhost creates a request factory with an initializer.
|
||||
HttpRequestFactory factory =
|
||||
module.provideHttpRequestFactory(new AppEngineConnectionFlags(
|
||||
HostAndPort.fromParts("localhost", 1000)),
|
||||
credentialProvider);
|
||||
module.provideHttpRequestFactory(
|
||||
new AppEngineConnectionFlags(HostAndPort.fromParts("localhost", 1000)),
|
||||
() -> FAKE_CREDENTIAL);
|
||||
HttpRequestInitializer initializer = factory.getInitializer();
|
||||
assertThat(initializer).isNotNull();
|
||||
assertThat(initializer).isNotSameAs(FAKE_CREDENTIAL);
|
||||
|
@ -69,9 +65,9 @@ public class DefaultRequestFactoryModuleTest {
|
|||
// Make sure that example.com creates a request factory with the UNITTEST client id but no
|
||||
// initializer.
|
||||
HttpRequestFactory factory =
|
||||
module.provideHttpRequestFactory(new AppEngineConnectionFlags(
|
||||
HostAndPort.fromParts("example.com", 1000)),
|
||||
credentialProvider);
|
||||
module.provideHttpRequestFactory(
|
||||
new AppEngineConnectionFlags(HostAndPort.fromParts("example.com", 1000)),
|
||||
() -> FAKE_CREDENTIAL);
|
||||
assertThat(factory.getInitializer()).isSameAs(FAKE_CREDENTIAL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue