Commit b4133849 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

any checks types after mockito upgrade

parent 0fc2fe62
Pipeline #6570 passed with stage
in 9 minutes and 27 seconds
package lcsb.mapviewer.converter.graphics;
import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.when;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import org.mockito.Mockito;
public abstract class GraphicsTestFunctions {
protected Graphics2D createGraphicsMock() {
Graphics2D graphics = Mockito.mock(Graphics2D.class);
FontMetrics fontMetrics = Mockito.mock(FontMetrics.class);
when(fontMetrics.getStringBounds(any(), any())).thenReturn(new Rectangle2D.Double());
when(graphics.getFontMetrics()).thenReturn(fontMetrics);
return graphics;
}
protected Graphics2D createGraphicsMock() {
Graphics2D graphics = Mockito.mock(Graphics2D.class);
FontMetrics fontMetrics = Mockito.mock(FontMetrics.class);
when(fontMetrics.getStringBounds(nullable(String.class), nullable(Graphics.class)))
.thenReturn(new Rectangle2D.Double());
when(graphics.getFontMetrics()).thenReturn(fontMetrics);
return graphics;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment