Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit dd6c9f86 authored by Pawel GUTOWSKI's avatar Pawel GUTOWSKI
Browse files

Merge pull request #80 in EDELIVERY/smp from...

Merge pull request #80 in EDELIVERY/smp from EDELIVERY-2302_refactoring_deprecated_classes to development

* commit 'ac7437bcd9fb33182c5bbbd99ee9bb1bba473430':
  EDELIVERY-2302 Refactored some classes
  EDELIVERY-2302 Refactored some classes
  EDELIVERY-2302 Refactored some classes
  EDELIVERY-2302 Refactored first 2 out of 3 deprecated classes
parents 676099c7 70749c06
No related branches found
No related tags found
No related merge requests found
Showing
with 57 additions and 19 deletions
......@@ -33,10 +33,7 @@ import javax.sql.DataSource;
@Configuration
@EnableTransactionManagement
@ComponentScan(basePackages = {
"eu.europa.ec.edelivery.smp.data.dao",
"eu.europa.ec.cipa.smp.server.services",
"eu.europa.ec.cipa.smp.server.hook"})
@ComponentScan(basePackages = {"eu.europa.ec.edelivery.smp.data.dao"})
public class DatabaseConfig {
@Value("${jdbc.driver}")
......
......@@ -25,11 +25,9 @@ import org.springframework.context.annotation.Import;
@ComponentScan(basePackages = {
"eu.europa.ec.edelivery.smp.validation",
"eu.europa.ec.edelivery.smp.services",
"eu.europa.ec.edelivery.smp.data.dao",
"eu.europa.ec.cipa.smp.server.hook",
"eu.europa.ec.edelivery.smp.conversion",
"eu.europa.ec.cipa.smp.server.util"})
@Import({PropertiesConfig.class, DatabaseConfig.class})
"eu.europa.ec.edelivery.smp.sml",
"eu.europa.ec.edelivery.smp.conversion"})
@Import(DatabaseConfig.class)
public class SmpAppConfig {
}
......@@ -13,7 +13,6 @@
package eu.europa.ec.edelivery.smp.config;
import eu.europa.ec.cipa.smp.server.util.SignatureFilter;
import eu.europa.ec.edelivery.smp.error.ErrorMappingControllerAdvice;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
......
......@@ -13,7 +13,6 @@
package eu.europa.ec.edelivery.smp.validation;
import eu.europa.ec.cipa.smp.server.util.IdentifierUtils;
import eu.europa.ec.edelivery.smp.error.exceptions.BadRequestException;
import eu.europa.ec.smp.api.Identifiers;
import org.oasis_open.docs.bdxr.ns.smp._2016._05.ParticipantIdentifierType;
......@@ -46,8 +45,8 @@ public class ServiceGroupValidator {
public void validate(String serviceGroupId, ServiceGroup serviceGroup) {
final ParticipantIdentifierType aServiceGroupID = Identifiers.asParticipantId(serviceGroupId);
if (!IdentifierUtils.areIdentifiersEqual(aServiceGroupID, serviceGroup.getParticipantIdentifier())) {
final ParticipantIdentifierType participantId = Identifiers.asParticipantId(serviceGroupId);
if (!participantId.equals(serviceGroup.getParticipantIdentifier())) {
// Business identifier must equal path
throw new BadRequestException(WRONG_FIELD, "Service Group Ids don't match between URL parameter and XML body");
}
......
......@@ -54,7 +54,8 @@
<param-name>contextConfigLocation</param-name>
<param-value>
eu.europa.ec.edelivery.smp.config.SpringSecurityConfig;
eu.europa.ec.edelivery.smp.config.SmpAppConfig
eu.europa.ec.edelivery.smp.config.SmpAppConfig;
eu.europa.ec.edelivery.smp.config.PropertiesConfig
</param-value>
</context-param>
<filter>
......
......@@ -13,10 +13,7 @@
package eu.europa.ec.cipa.smp.server.security;
import eu.europa.ec.edelivery.smp.config.PropertiesConfig;
import eu.europa.ec.edelivery.smp.config.DatabaseConfig;
import eu.europa.ec.edelivery.smp.config.SpringSecurityConfig;
import eu.europa.ec.edelivery.smp.config.SpringSecurityTestConfig;
import eu.europa.ec.edelivery.smp.config.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -43,7 +40,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {
PropertiesConfig.class,
PropertiesTestConfig.class,
DatabaseConfig.class,
SpringSecurityConfig.class,
SpringSecurityTestConfig.class
......
......@@ -15,6 +15,7 @@ package eu.europa.ec.cipa.smp.server.security;
import eu.europa.ec.edelivery.security.PreAuthenticatedCertificatePrincipal;
import eu.europa.ec.edelivery.smp.config.PropertiesTestConfig;
import eu.europa.ec.edelivery.smp.config.SmpAppConfig;
import eu.europa.ec.edelivery.smp.config.SmpWebAppConfig;
import eu.europa.ec.edelivery.smp.config.SpringSecurityConfig;
......@@ -64,6 +65,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {
PropertiesTestConfig.class,
SmpAppConfig.class,
SmpWebAppConfig.class,
SpringSecurityConfig.class
......
/*
* Copyright 2018 European Commission | CEF eDelivery
*
* Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence attached in file: LICENCE-EUPL-v1.2.pdf
*
* Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
package eu.europa.ec.edelivery.smp.config;
import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import java.util.Properties;
/**
* Created by gutowpa on 11/01/2018.
*/
@Configuration
@PropertySources({
@PropertySource(value = "classpath:config.properties", ignoreResourceNotFound = true)
})
public class PropertiesTestConfig {
private final static String SIGNING_KEYSTORE_PATH = Thread.currentThread().getContextClassLoader().getResource("signature_keys.jks").getFile();
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer propertiesConfig = new PropertySourcesPlaceholderConfigurer();
Properties localProps = new Properties();
localProps.setProperty("xmldsig.keystore.classpath", SIGNING_KEYSTORE_PATH);
propertiesConfig.setProperties(localProps);
propertiesConfig.setLocalOverride(true);
return propertiesConfig;
}
}
......@@ -13,6 +13,7 @@
package eu.europa.ec.edelivery.smp.controllers;
import eu.europa.ec.edelivery.smp.config.PropertiesTestConfig;
import eu.europa.ec.edelivery.smp.config.SmpAppConfig;
import eu.europa.ec.edelivery.smp.config.SmpWebAppConfig;
import eu.europa.ec.edelivery.smp.config.SpringSecurityConfig;
......@@ -50,6 +51,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {
PropertiesTestConfig.class,
SmpAppConfig.class,
SmpWebAppConfig.class,
SpringSecurityConfig.class})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment