From b69eca68e43005e17affab5777128a1de1752e0f Mon Sep 17 00:00:00 2001
From: Joze RIHTARSIC <joze.rihtarsic@ext.ec.europa.eu>
Date: Wed, 9 Oct 2019 15:02:02 +0200
Subject: [PATCH] Fix tooltip for validation XML and sonar warnings

---
 ...ervice-group-details-dialog.component.html |  2 +-
 .../ec/edelivery/smp/sml/SmlConnector.java    | 31 +++++--------------
 .../database-scripts/mysql5innodb-data.sql    |  2 +-
 3 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/smp-angular/src/app/service-group-edit/service-group-details-dialog/service-group-details-dialog.component.html b/smp-angular/src/app/service-group-edit/service-group-details-dialog/service-group-details-dialog.component.html
index 79ba8b1d5..e508111f3 100644
--- a/smp-angular/src/app/service-group-edit/service-group-details-dialog/service-group-details-dialog.component.html
+++ b/smp-angular/src/app/service-group-edit/service-group-details-dialog/service-group-details-dialog.component.html
@@ -143,7 +143,7 @@
               <span>Extension wizard</span>
             </button>
             <button mat-raised-button color="primary"
-                    atTooltip="Validate extension by XSD scheme."
+                    matTooltip="Validate extension by XSD scheme."
                     matTooltipPosition="below"
                     (click)="onExtensionValidate()">
               <mat-icon>warning</mat-icon>
diff --git a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/sml/SmlConnector.java b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/sml/SmlConnector.java
index 01b760076..de9e1b19b 100644
--- a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/sml/SmlConnector.java
+++ b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/sml/SmlConnector.java
@@ -97,17 +97,18 @@ public class SmlConnector implements ApplicationContextAware {
         if (!configurationService.isSMLIntegrationEnabled()) {
             return false;
         }
+        String normalizedParticipantString = asString(normalizedParticipantId);
         if (!domain.isSmlRegistered()) {
             LOG.info("Participant {} is not registered to SML because domain {} is not registered!" ,
-                    asString(normalizedParticipantId), domain.getDomainCode());
+                    normalizedParticipantString, domain.getDomainCode());
             return false;
         }
 
-        LOG.debug("Registering new Participant: {} to domain: {}." , asString(normalizedParticipantId), domain.getDomainCode());
+        LOG.debug("Registering new Participant: {} to domain: {}." , normalizedParticipantString, domain.getDomainCode());
         try {
             ServiceMetadataPublisherServiceForParticipantType smlRequest = toBusdoxParticipantId(normalizedParticipantId, domain.getSmlSmpId());
             getParticipantWSClient(domain).create(smlRequest);
-            LOG.info("Participant: {} registered to domain: {}." , asString(normalizedParticipantId), domain.getDomainCode());
+            LOG.info("Participant: {} registered to domain: {}." , normalizedParticipantString, domain.getDomainCode());
             return true;
         } catch (BadRequestFault e) {
             return processSMLErrorMessage(e, normalizedParticipantId);
@@ -222,17 +223,18 @@ public class SmlConnector implements ApplicationContextAware {
         if (!configurationService.isSMLIntegrationEnabled()) {
             return false;
         }
+        String normalizedParticipantString = asString(normalizedParticipantId);
         if (!domain.isSmlRegistered()) {
             LOG.info("Participant {} is not unregistered from SML because domain {} is not registered!" ,
-                    asString(normalizedParticipantId), domain.getDomainCode());
+                    normalizedParticipantString, domain.getDomainCode());
             return false;
         }
 
-        LOG.debug("Removing Participant: {} from domain: {}.", asString(normalizedParticipantId), domain.getDomainCode());
+        LOG.debug("Removing Participant: {} from domain: {}.", normalizedParticipantString, domain.getDomainCode());
         try {
             ServiceMetadataPublisherServiceForParticipantType smlRequest = toBusdoxParticipantId(normalizedParticipantId, domain.getSmlSmpId());
             getParticipantWSClient(domain).delete(smlRequest);
-            LOG.info("Participant: {} removed domain: {}.", asString(normalizedParticipantId), domain.getDomainCode());
+            LOG.info("Participant: {} removed domain: {}.", normalizedParticipantString, domain.getDomainCode());
             return true;
         } catch (BadRequestFault e) {
             return processSMLErrorMessage(e, normalizedParticipantId);
@@ -383,23 +385,6 @@ public class SmlConnector implements ApplicationContextAware {
 
     }
 
-    SSLSocketFactory createSocketFactory() {
-
-        SSLContext sc = null;
-        try {
-            sc = SSLContext.getInstance("TLS");
-            sc.init(keystoreService.getKeyManagers(),
-                    truststoreService.getTrustManagers(), null);
-
-
-        } catch (NoSuchAlgorithmException | KeyManagementException e) {
-            e.printStackTrace();
-        }
-
-        return sc.getSocketFactory();
-
-
-    }
 
     public CertificateConstraintsType createCertConstraint(String regExp){
         if (StringUtils.isBlank(regExp)){
diff --git a/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql b/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql
index ae19eda1c..264bb6d62 100644
--- a/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql
+++ b/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql
@@ -7,4 +7,4 @@ update SMP_USER_SEQ set next_val=4 where next_val=1;
 
 -- insert domain
 insert into SMP_DOMAIN (ID, DOMAIN_CODE, SML_SUBDOMAIN, SML_SMP_ID, SIGNATURE_KEY_ALIAS, SML_BLUE_COAT_AUTH,SML_REGISTERED, CREATED_ON, LAST_UPDATED_ON) values (1, 'testDomain','test','CEF-SMP-002', 'sample_key', 1,0, NOW(), NOW());
-update SMP_DOMAIN_SEQ set next_val=2 where next_val=1;
+update SMP_DOMAIN_SEQ set next_val=2 y;
-- 
GitLab