mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 17:07:15 +02:00
Refactor Guava functional methods to use lambdas
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177027488
This commit is contained in:
parent
2ae496bfce
commit
bbe2584da4
47 changed files with 478 additions and 647 deletions
|
@ -41,8 +41,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
/** Unit tests for {@link UrlFetchUtils}. */
|
||||
@RunWith(JUnit4.class)
|
||||
|
@ -62,12 +60,13 @@ public class UrlFetchUtilsTest {
|
|||
public void setupRandomZeroes() throws Exception {
|
||||
Random random = mock(Random.class);
|
||||
inject.setStaticField(UrlFetchUtils.class, "random", random);
|
||||
doAnswer(new Answer<Void>() {
|
||||
@Override
|
||||
public Void answer(InvocationOnMock info) throws Throwable {
|
||||
Arrays.fill((byte[]) info.getArguments()[0], (byte) 0);
|
||||
return null;
|
||||
}}).when(random).nextBytes(any(byte[].class));
|
||||
doAnswer(
|
||||
info -> {
|
||||
Arrays.fill((byte[]) info.getArguments()[0], (byte) 0);
|
||||
return null;
|
||||
})
|
||||
.when(random)
|
||||
.nextBytes(any(byte[].class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue