Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Aug 1, 2022
1 parent 476b6a7 commit 34e55be
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import org.junit.Test;
import org.junit.rules.MethodRule;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.stubbing.Answer;

import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -108,6 +110,13 @@ public void setUp() throws Exception {
when(auxiliaryTypeDescription.getInternalName()).thenReturn(QUXBAZ);
when(auxiliaryType.getTypeDescription()).thenReturn(auxiliaryTypeDescription);
when(auxiliaryType.getBytes()).thenReturn(BINARY_SECOND);
when(auxiliaryType.locate(anyString())).thenAnswer(new Answer<ClassFileLocator.Resolution>() {

public ClassFileLocator.Resolution answer(InvocationOnMock invocation) {
return new ClassFileLocator.Resolution.Illegal(invocation.getArgument(0, String.class));
}
});
when(auxiliaryType.locate(QUXBAZ.replace('/', '.'))).thenReturn(new ClassFileLocator.Resolution.Explicit(BINARY_SECOND));
when(auxiliaryType.getLoadedTypeInitializers()).thenReturn(Collections.singletonMap(auxiliaryTypeDescription, auxiliaryLoadedTypeInitializer));
when(auxiliaryType.getAuxiliaryTypes()).thenReturn(Collections.<TypeDescription, byte[]>emptyMap());
when(auxiliaryType.getAllTypes()).thenReturn(Collections.singletonMap(auxiliaryTypeDescription, BINARY_SECOND));
Expand Down

0 comments on commit 34e55be

Please sign in to comment.