Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit d97deba0 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

make tests more robust.

parent 2e99b92d
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@
<slf4j.version>1.7.36</slf4j.version>
<soapui.plugin.version>5.1.2</soapui.plugin.version>
<spring-modules-jakarta-commons.version>0.8</spring-modules-jakarta-commons.version>
<spring.boot.version>2.7.0</spring.boot.version>
<spring.boot.version>2.7.4</spring.boot.version>
<spring.security.version>5.7.2</spring.security.version>
<spring.version>5.3.21</spring.version>
<xmlunit.version>2.9.0</xmlunit.version>
......@@ -692,7 +692,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>7.1.1</version>
<version>7.1.2</version>
<inherited>false</inherited>
<configuration>
<skipProvidedScope>true</skipProvidedScope>
......
......@@ -52,7 +52,12 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@ContextConfiguration(classes = {SmpTestWebAppConfig.class})
@Sql(scripts = {
"classpath:/cleanup-database.sql",
"classpath:/webapp_integration_test_data.sql"},
"classpath:/webapp_integration_test_data.sql",
},
statements = {
"update SMP_CONFIGURATION set VALUE='false', LAST_UPDATED_ON=CURRENT_TIMESTAMP() where PROPERTY='identifiersBehaviour.scheme.mandatory';",
"update SMP_CONFIGURATION set VALUE='true', LAST_UPDATED_ON=CURRENT_TIMESTAMP() where PROPERTY='smp.automation.authentication.external.tls.clientCert.enabled';"
},
executionPhase = BEFORE_TEST_METHOD)
public class ServiceGroupControllerTest {
......@@ -91,8 +96,6 @@ public class ServiceGroupControllerTest {
@Before
public void setup() throws IOException {
forwardedHeaderTransformer.setRemoveOnly(false);
configurationDao.setPropertyToDatabase(SMPPropertyEnum.EXTERNAL_TLS_AUTHENTICATION_CLIENT_CERT_HEADER_ENABLED, "true", null);
configurationDao.setPropertyToDatabase(SMPPropertyEnum.PARTC_SCH_MANDATORY, "false", null);
X509CertificateTestUtils.reloadKeystores();
mvc = MockMvcUtils.initializeMockMvc(webAppContext);
configurationDao.reloadPropertiesFromDatabase();
......@@ -116,8 +119,6 @@ public class ServiceGroupControllerTest {
@Test
public void adminCanCreateServiceGroupNullScheme() throws Exception {
// make sure identifiersBehaviour.scheme.allowNull is set to true in db script
// set identifiersBehaviour.scheme.mandatory to false
mvc.perform(put(URL_PATH_NULL_SCHEME)
.with(ADMIN_CREDENTIALS)
.header(HTTP_HEADER_KEY_DOMAIN, HTTP_DOMAIN_VALUE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment