SensorContext context = mock(SensorContext.class);
final SensorStorage sensorStorage = mock(SensorStorage.class);
Settings settings = new Settings();
settings.setProperty(OneIssuePerLineSensor.FORCE_SEVERITY_PROPERTY, "MINOR");
when(context.settings()).thenReturn(settings);
when(context.fileSystem()).thenReturn(fs);
when(context.newIssue()).thenAnswer(new Answer<Issue>() {
@Override
public Issue answer(InvocationOnMock invocation) throws Throwable {
return new DefaultIssue(sensorStorage);
}