import javax.annotation.Nullable;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
-import org.sonar.ce.log.CeLogging;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.ce.CeActivityDto;
public class TaskFormatter {
private final DbClient dbClient;
- private final CeLogging ceLogging;
private final System2 system2;
- public TaskFormatter(DbClient dbClient, CeLogging ceLogging, System2 system2) {
+ public TaskFormatter(DbClient dbClient, System2 system2) {
this.dbClient = dbClient;
- this.ceLogging = ceLogging;
this.system2 = system2;
}
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
-import org.sonar.ce.log.CeLogging;
import org.sonar.ce.taskprocessor.CeTaskProcessor;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.db.DbTester;
public class ActivityActionTest {
private static final long EXECUTED_AT = System2.INSTANCE.now();
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Rule
ComponentDbTester componentDb = new ComponentDbTester(dbTester);
- CeLogging ceLogging = mock(CeLogging.class);
- TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient(), ceLogging, System2.INSTANCE);
+ TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient(), System2.INSTANCE);
ActivityAction underTest = new ActivityAction(userSession, dbTester.getDbClient(), formatter, new CeTaskProcessor[] {mock(CeTaskProcessor.class)});
WsActionTester ws = new WsActionTester(underTest);
import org.junit.Test;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
-import org.sonar.ce.log.CeLogging;
import org.sonar.core.util.Protobuf;
import org.sonar.db.DbTester;
import org.sonar.db.ce.CeActivityDto;
import org.sonarqube.ws.WsCe;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
public class ComponentActionTest {
@Rule
public DbTester dbTester = DbTester.create(System2.INSTANCE);
- CeLogging ceLogging = mock(CeLogging.class);
- TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient(), ceLogging, System2.INSTANCE);
+ TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient(), System2.INSTANCE);
ComponentAction underTest = new ComponentAction(userSession, dbTester.getDbClient(), formatter);
WsActionTester tester = new WsActionTester(underTest);
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
-import org.sonar.ce.log.CeLogging;
import org.sonar.core.util.Protobuf;
import org.sonar.db.DbTester;
import org.sonar.db.ce.CeActivityDto;
import org.sonarqube.ws.WsCe;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
import static org.sonar.core.permission.GlobalPermissions.PROVISIONING;
import static org.sonar.core.permission.GlobalPermissions.SCAN_EXECUTION;
import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
@Rule
public DbTester dbTester = DbTester.create(System2.INSTANCE);
- CeLogging ceLogging = mock(CeLogging.class);
- TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient(), ceLogging, System2.INSTANCE);
+ TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient(), System2.INSTANCE);
TaskAction underTest = new TaskAction(dbTester.getDbClient(), formatter, userSession);
WsActionTester ws = new WsActionTester(underTest);
import java.util.Date;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.mockito.Mockito;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
-import org.sonar.ce.log.CeLogging;
import org.sonar.db.DbTester;
import org.sonar.db.ce.CeActivityDto;
import org.sonar.db.ce.CeQueueDto;
public class TaskFormatterTest {
- @Rule
- public TemporaryFolder temp = new TemporaryFolder();
-
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
- System2 system2 = mock(System2.class);
- CeLogging ceLogging = mock(CeLogging.class, Mockito.RETURNS_DEEP_STUBS);
- TaskFormatter underTest = new TaskFormatter(db.getDbClient(), ceLogging, system2);
+ private System2 system2 = mock(System2.class);
+ private TaskFormatter underTest = new TaskFormatter(db.getDbClient(), system2);
@Test
public void formatQueue_without_component() {