--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 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.ce.task.projectanalysis.dependency;
+
+import javax.annotation.ParametersAreNonnullByDefault;
private ServerProcessLogging getServerProcessLoggingFakeImpl(ProcessId processId, String threadIdFieldPattern) {
return new ServerProcessLogging(processId, threadIdFieldPattern) {
@Override
- protected void extendLogLevelConfiguration(LogLevelConfig.Builder logLevelConfigBuilder) {}
+ protected void extendLogLevelConfiguration(LogLevelConfig.Builder logLevelConfigBuilder) {
+ //Not needed for this test
+ }
@Override
- protected void extendConfigure(Props props) {}
+ protected void extendConfigure(Props props) {
+ //Not needed for this test
+ }
};
}
}
import org.junit.Test;
import org.sonar.api.server.http.Cookie;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
assertThat(underTest.getDelegate()).isSameAs(responseMock);
assertThat(underTest.getHeader("h1")).isEqualTo("hvalue1");
- assertThat(underTest.getHeaders("h1")).asList().containsExactly("hvalue1");
+ assertThat(underTest.getHeaders("h1")).containsExactly("hvalue1");
assertThat(underTest.getStatus()).isEqualTo(200);
assertThat(underTest.getWriter()).isEqualTo(writer);
assertThat(underTest.getOutputStream()).isEqualTo(outputStream);
@Test
public void broadcastOnIssueChange_passes_immutable_set_of_ChangedIssues() {
- QGChangeEventListenersImpl underTest = new QGChangeEventListenersImpl(Set.of(listener1));
+ var qgChangeEventListeners = new QGChangeEventListenersImpl(Set.of(listener1));
- underTest.broadcastOnIssueChange(oneIssueOnComponent1, singletonList(component1QGChangeEvent), false);
+ qgChangeEventListeners.broadcastOnIssueChange(oneIssueOnComponent1, singletonList(component1QGChangeEvent), false);
ArgumentCaptor<Set<ChangedIssue>> changedIssuesCaptor = newSetCaptor();
inOrder.verify(listener1).onIssueChanges(same(component1QGChangeEvent), changedIssuesCaptor.capture());
@Test
public void broadcastOnIssueChange_has_no_effect_when_no_listener() {
- QGChangeEventListenersImpl underTest = new QGChangeEventListenersImpl(Set.of());
+ var qgChangeEventListeners = new QGChangeEventListenersImpl(Set.of());
- underTest.broadcastOnIssueChange(oneIssueOnComponent1, singletonList(component1QGChangeEvent), false);
+ qgChangeEventListeners.broadcastOnIssueChange(oneIssueOnComponent1, singletonList(component1QGChangeEvent), false);
verifyNoInteractions(listener1, listener2, listener3);
}
}
@Override
- public void doFilter(HttpRequest request, HttpResponse response, org.sonar.api.web.FilterChain chain) throws IOException {
-
+ public void doFilter(HttpRequest request, HttpResponse response, org.sonar.api.web.FilterChain chain) {
+ //Not needed for this test
}
@Override