Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend TestClientUtil with parameter #219

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.draeger.medical.sdccc.configuration;

import com.draeger.medical.sdccc.util.Constants;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.somda.sdc.common.guice.AbstractConfigurationModule;

Expand Down Expand Up @@ -49,6 +50,10 @@ void configureTestSuite() {

bind(TestSuiteConfig.ENABLE_MESSAGE_ENCODING_CHECK, Boolean.class, true);
bind(TestSuiteConfig.SUMMARIZE_MESSAGE_ENCODING_ERRORS, Boolean.class, true);
bind(Constants.CONFIGURATION_MODULE, AbstractConfigurationModule.class, new AbstractConfigurationModule() {
@Override
protected void defaultConfigure() {}
});
}

void configureTLS() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.draeger.medical.sdccc.sdcri.CommunicationLogMessageStorage;
import com.draeger.medical.sdccc.tests.util.MdibHistorian;
import com.draeger.medical.sdccc.tests.util.guice.MdibHistorianFactory;
import com.draeger.medical.sdccc.util.Constants;
import com.draeger.medical.sdccc.util.TestRunObserver;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
Expand Down Expand Up @@ -61,6 +62,7 @@ public class TestClientUtil {
* Values from 1 to 255 are valid.
* @param enabledTlsProtocols TLS protocol versions to be enabled
* @param enabledCiphers ciphers to be enabled
* @param configurationModule configuration for AbstractConfigurationModule
*/
@Inject
public TestClientUtil(
Expand All @@ -70,7 +72,8 @@ public TestClientUtil(
final LocalAddressResolver localAddressResolver,
@Named(TestSuiteConfig.NETWORK_MULTICAST_TTL) final Long multicastTTL,
@Named(TestSuiteConfig.TLS_ENABLED_PROTOCOLS) final String[] enabledTlsProtocols,
@Named(TestSuiteConfig.TLS_ENABLED_CIPHERS) final String[] enabledCiphers) {
@Named(TestSuiteConfig.TLS_ENABLED_CIPHERS) final String[] enabledCiphers,
@Named(Constants.CONFIGURATION_MODULE) final AbstractConfigurationModule configurationModule) {

injector = createClientInjector(List.of(
new AbstractConfigurationModule() {
Expand Down Expand Up @@ -98,7 +101,8 @@ protected void configure() {
bind(TestRunObserver.class).toInstance(testRunObserver);
bind(LocalAddressResolver.class).toInstance(localAddressResolver);
}
}));
},
configurationModule));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public final class Constants {
public static final String ENABLE_SETTING_POSTFIX = "Enable";
public static final String DEVICE_EPR_POSTFIX = "DeviceEpr";
public static final String FIELD_ACCESS_ERROR_BASE_MESSAGE = "Error while accessing field {}";
public static final String CONFIGURATION_MODULE = "ConfigurationModule";

/*
MDPWS constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.draeger.medical.sdccc.messages.HibernateConfig;
import com.draeger.medical.sdccc.sdcri.testclient.TestClient;
import com.draeger.medical.sdccc.tests.InjectorTestBase;
import com.draeger.medical.sdccc.util.Constants;
import com.draeger.medical.sdccc.util.HibernateConfigInMemoryImpl;
import com.draeger.medical.sdccc.util.TestRunObserver;
import com.google.inject.AbstractModule;
Expand Down Expand Up @@ -632,6 +633,10 @@ protected void defaultConfigure() {

bind(Identifiers.DIRECT_TEST_IDENTIFIER_FAILING, Boolean.class, failingTests);
bind(Identifiers.INVARIANT_TEST_IDENTIFIER_FAILING, Boolean.class, failingTests);
bind(Constants.CONFIGURATION_MODULE, AbstractConfigurationModule.class, new AbstractConfigurationModule() {
@Override
protected void defaultConfigure() {}
});
}
}
}
Loading