Skip to content
Snippets Groups Projects
Commit f71e7d98 authored by Lukas Malte Monnerjahn's avatar Lukas Malte Monnerjahn
Browse files

KOP-2139 sonar findings

- keyword order
- removed commented out code
- removed superfluous throws
- AssertJ containsEntry and hasSize
parent f4b1a4f0
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor(access = PRIVATE)
@Builder
public class XtaConfigValidator {
private final static Validator VALIDATOR;
private static final Validator VALIDATOR;
static {
try (var factory = Validation.buildDefaultValidatorFactory()) {
......
......@@ -25,7 +25,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class XtaPortTripleFactory {
final static String SCHEMA_VALIDATION_ENABLED_KEY = "schema-validation-enabled";
static final String SCHEMA_VALIDATION_ENABLED_KEY = "schema-validation-enabled";
private final XTAService xtaService;
private final XtaClientConfig config;
......@@ -65,7 +65,7 @@ public class XtaPortTripleFactory {
return ClientProxy.getClient(port);
}
void configureRequestContext(final String endpointUrl, Map<String, Object> requestContext) throws ClientInitializationException {
void configureRequestContext(final String endpointUrl, Map<String, Object> requestContext) {
requestContext.putAll(Map.of(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointUrl,
SCHEMA_VALIDATION_ENABLED_KEY, config.isSchemaValidation(),
......
......@@ -34,27 +34,21 @@ public class XtaDevServerSetupExtension implements BeforeAllCallback, BeforeEach
private XtaClientFactory clientFactory;
static final String BASE_URL = "https://li33-0005.dp.dsecurecloud.de/MB_XTA-WS/XTA210";
// static final String CLIENT_IDENTIFIER1 = "dp:012345678910_XtaClientITCase1";
static final Identifier CLIENT_IDENTIFIER1 = Identifier.builder()
.value("gad:010103000000")
.category("DMS Schleswig-Holstein")
.name("Generischer Antragsdienst")
.build();
// static final Identifier CLIENT_IDENTIFIER1 = Identifier.builder()
// .value("gae:test-environment@ozg-cloud.de")
// .category("Generischer Antragsempfänger")
// .name("Test-Umgebung")
// .build();
// static final Identifier CLIENT_IDENTIFIER2 = Identifier.builder()
// .value("vbe:010550120100")
// .name("L100012.OE.279550874")
// .category("Versammlungsbehörde")
// .build();
static final Identifier CLIENT_IDENTIFIER2 = Identifier.builder()
.value("gae:test-environment@ozg-cloud.de")
.category("Generischer Antragsempfänger")
.name("Test-Umgebung")
.build();
static final Identifier CLIENT_IDENTIFIER3 = Identifier.builder()
.value("vbe:010550120100")
.name("L100012.OE.279550874")
.category("Versammlungsbehörde")
.build();
@Override
@SneakyThrows
......
package de.ozgcloud.xta.client.core;
import static de.ozgcloud.xta.client.core.XtaPortTripleFactory.*;
import static org.assertj.core.api.AssertionsForClassTypes.*;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;
import java.util.ArrayList;
......@@ -197,7 +197,7 @@ class XtaPortTripleFactoryTest {
void shouldKeepOld() {
factory.configureRequestContext(endpointUrl, requestContext);
assertThat(requestContext.get("old")).isEqualTo("value");
assertThat(requestContext).containsEntry("old", "value");
}
@DisplayName("should add endpoint url")
......@@ -206,7 +206,7 @@ class XtaPortTripleFactoryTest {
void shouldAddEndpointUrl() {
factory.configureRequestContext(endpointUrl, requestContext);
assertThat(requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY)).isEqualTo(endpointUrl);
assertThat(requestContext).containsEntry(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointUrl);
}
@DisplayName("should add schema validation")
......@@ -219,7 +219,7 @@ class XtaPortTripleFactoryTest {
factory.configureRequestContext(endpointUrl, requestContext);
assertThat(requestContext.get(SCHEMA_VALIDATION_ENABLED_KEY)).isEqualTo(validation);
assertThat(requestContext).containsEntry(SCHEMA_VALIDATION_ENABLED_KEY, validation);
}
}
......@@ -303,7 +303,7 @@ class XtaPortTripleFactoryTest {
void shouldAddOneInterceptor() {
factory.configureInInterceptors(inInterceptors);
assertThat(inInterceptors.size()).isEqualTo(1);
assertThat(inInterceptors).hasSize(1);
}
@DisplayName("should add in interceptor")
......@@ -332,7 +332,7 @@ class XtaPortTripleFactoryTest {
void shouldAddOneInterceptor() {
factory.configureOutInterceptors(outInterceptors);
assertThat(outInterceptors.size()).isEqualTo(1);
assertThat(outInterceptors).hasSize(1);
}
@DisplayName("should add out interceptor")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment