dbTester.getSession().commit();
dbTester.getSession().close();
- assertThatThrownBy(() -> underTest.execute(new TestComputationStepContext()))
+ TestComputationStepContext testComputationStepContext = new TestComputationStepContext();
+ assertThatThrownBy(() -> underTest.execute(testComputationStepContext))
.isInstanceOf(IllegalStateException.class)
.hasMessage("Decompression failed because unzipped size reached threshold: 4000000000 bytes");
}
import org.sonar.process.systeminfo.SystemInfoUtils;
import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo;
import org.sonar.server.health.Health;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
public abstract class AbstractSystemInfoWriter implements SystemInfoWriter {
private static final String[] ORDERED_SECTION_NAMES = {
"Compute Engine Tasks", "Compute Engine JVM State", "Compute Engine Database Connection", "Compute Engine Logging", "Compute Engine JVM Properties",
"Search State", "Search Indexes"};
- private final TelemetryDataJsonWriter dataJsonWriter;
-
- AbstractSystemInfoWriter(TelemetryDataJsonWriter dataJsonWriter) {
- this.dataJsonWriter = dataJsonWriter;
- }
-
protected void writeSections(Collection<ProtobufSystemInfo.Section> sections, JsonWriter json) {
SystemInfoUtils
.order(sections, ORDERED_SECTION_NAMES)
import org.sonar.server.platform.monitoring.cluster.GlobalInfoLoader;
import org.sonar.server.platform.monitoring.cluster.NodeInfo;
import org.sonar.server.platform.monitoring.cluster.SearchNodesInfoLoader;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
-import org.sonar.server.telemetry.TelemetryDataLoader;
public class ClusterSystemInfoWriter extends AbstractSystemInfoWriter {
private final GlobalInfoLoader globalInfoLoader;
private final HealthChecker healthChecker;
public ClusterSystemInfoWriter(GlobalInfoLoader globalInfoLoader, AppNodesInfoLoader appNodesInfoLoader, SearchNodesInfoLoader searchNodesInfoLoader,
- HealthChecker healthChecker, TelemetryDataJsonWriter dataJsonWriter) {
- super(dataJsonWriter);
+ HealthChecker healthChecker) {
this.globalInfoLoader = globalInfoLoader;
this.appNodesInfoLoader = appNodesInfoLoader;
this.searchNodesInfoLoader = searchNodesInfoLoader;
import org.sonar.server.ce.http.CeHttpClient;
import org.sonar.server.health.Health;
import org.sonar.server.health.HealthChecker;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
import static java.util.Arrays.stream;
private final HealthChecker healthChecker;
private final SystemInfoSection[] systemInfoSections;
- public StandaloneSystemInfoWriter(CeHttpClient ceHttpClient, HealthChecker healthChecker,
- TelemetryDataJsonWriter dataJsonWriter, SystemInfoSection... systemInfoSections) {
- super(dataJsonWriter);
+ public StandaloneSystemInfoWriter(CeHttpClient ceHttpClient, HealthChecker healthChecker, SystemInfoSection... systemInfoSections) {
this.ceHttpClient = ceHttpClient;
this.healthChecker = healthChecker;
this.systemInfoSections = systemInfoSections;
import org.sonar.server.platform.monitoring.cluster.GlobalInfoLoader;
import org.sonar.server.platform.monitoring.cluster.NodeInfo;
import org.sonar.server.platform.monitoring.cluster.SearchNodesInfoLoader;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
private final AppNodesInfoLoader appNodesInfoLoader = mock(AppNodesInfoLoader.class);
private final SearchNodesInfoLoader searchNodesInfoLoader = mock(SearchNodesInfoLoader.class);
private final HealthChecker healthChecker = mock(HealthChecker.class);
- private final TelemetryDataJsonWriter dataJsonWriter = new TelemetryDataJsonWriter();
private final ClusterSystemInfoWriter underTest = new ClusterSystemInfoWriter(globalInfoLoader, appNodesInfoLoader,
- searchNodesInfoLoader, healthChecker, dataJsonWriter);
+ searchNodesInfoLoader, healthChecker);
@Before
public void before() throws InterruptedException {
import org.sonar.server.ce.http.CeHttpClient;
import org.sonar.server.ce.http.CeHttpClientImpl;
import org.sonar.server.health.TestStandaloneHealthChecker;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
-import org.sonar.server.telemetry.TelemetryDataLoader;
import org.sonar.server.tester.UserSessionRule;
import static org.assertj.core.api.Assertions.assertThat;
private final SystemInfoSection section2 = mock(SystemInfoSection.class);
private final CeHttpClient ceHttpClient = mock(CeHttpClientImpl.class, Mockito.RETURNS_MOCKS);
private final TestStandaloneHealthChecker healthChecker = new TestStandaloneHealthChecker();
- private final TelemetryDataJsonWriter dataJsonWriter = new TelemetryDataJsonWriter();
- private final StandaloneSystemInfoWriter underTest = new StandaloneSystemInfoWriter(ceHttpClient, healthChecker, dataJsonWriter, section1, section2);
+ private final StandaloneSystemInfoWriter underTest = new StandaloneSystemInfoWriter(ceHttpClient, healthChecker, section1, section2);
@Test
public void write_json() {
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.server.saml.ws;
+
+import javax.annotation.ParametersAreNonnullByDefault;