Skip to content

Commit

Permalink
Sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rjpmestre committed Feb 24, 2025
1 parent a9794ab commit 3275d4a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static com.suse.utils.Predicates.isAbsent;
import static java.util.Arrays.asList;

import com.redhat.rhn.common.conf.ConfigDefaults;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;

Expand Down Expand Up @@ -79,7 +78,8 @@ public ProxyConfig getProxyConfig(Server server) {
*/
@Override
public Map<String, Object> getFormData(User user, Server server) {
ProxyConfigGetFormDataContext context = new ProxyConfigGetFormDataContext(user, server, this.getProxyConfig(server));
ProxyConfigGetFormDataContext context =
new ProxyConfigGetFormDataContext(user, server, this.getProxyConfig(server));

for (ProxyConfigGetFormDataContextHandler handler : getFormDataContextHandlerChain) {
handler.handle(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public ProxyConfig getProxyConfig() {
public String getInitFailMessage() {
return initFailMessage;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import com.redhat.rhn.common.RhnGeneralException;
import com.redhat.rhn.testing.MockObjectTestCase;

import com.suse.proxy.update.ProxyConfigUpdateFacadeImpl;
import com.suse.proxy.update.ProxyConfigUpdateContext;
import com.suse.proxy.update.ProxyConfigUpdateContextHandler;
import com.suse.proxy.update.ProxyConfigUpdateFacadeImpl;

import org.jmock.junit5.JUnit5Mockery;
import org.junit.Test;
Expand Down Expand Up @@ -127,8 +127,10 @@ public void handle(ProxyConfigUpdateContext context) {
* @throws IllegalAccessException if the field cannot be accessed
*/
@SuppressWarnings("squid:S3011")
private void replaceHandlers(ProxyConfigUpdateFacadeImpl proxyConfigUpdate, List<ProxyConfigUpdateContextHandler> handlers)
throws NoSuchFieldException, IllegalAccessException {
private void replaceHandlers(
ProxyConfigUpdateFacadeImpl proxyConfigUpdate,
List<ProxyConfigUpdateContextHandler> handlers
) throws NoSuchFieldException, IllegalAccessException {
Field field = ProxyConfigUpdateFacadeImpl.class.getDeclaredField("contextHandlerChain");
field.setAccessible(true);
field.set(proxyConfigUpdate, handlers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public class ProxyConfigUpdateRegistryPreConditionsTest extends MockObjectTestCa
*/
@Test
public void testSuccessWhenBlankRequest() {
ProxyConfigUpdateContext proxyConfigUpdateContext = new ProxyConfigUpdateContext(new ProxyConfigUpdateJson(), null, null, null);
ProxyConfigUpdateContext proxyConfigUpdateContext =
new ProxyConfigUpdateContext(new ProxyConfigUpdateJson(), null, null, null);
new ProxyConfigUpdateRegistryPreConditions().handle(proxyConfigUpdateContext);
assertFalse(proxyConfigUpdateContext.getErrorReport().hasErrors());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1094,11 +1094,11 @@ insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type )
insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type )
values (lookup_server_arch('armv7l-debian-linux'),
lookup_sg_type('proxy_entitled'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type )
values (lookup_server_arch('cloud'),
lookup_sg_type('proxy_entitled
l_server'));
lookup_sg_type('proxy_entitled'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type )
values (lookup_server_arch('arm64-debian-linux'),
lookup_sg_type('proxy_entitled'));
Expand Down

0 comments on commit 3275d4a

Please sign in to comment.