Ottava puntata del MuleSoft Meetup di Milano. Parliamo insieme a Paolo Petronzi di metodologie di testing e automazione con MUnit e poi con Luca Bonaldo, il nostro Mulesoft Mentor in Italia, dell'integrazione con Salesforce.
https://meetups.mulesoft.com/events/details/mulesoft-milano-presents-mulesoft-milano-meetup-8/
Five ways to smash barriers to SharePoint adoption
Milano Meetup #8 - Testing & Salesforce Integration
1. 19 Maggio 2022
MILANO MuleSoft Meetup Group
L’importanza del Testing e la sua automazione - Paolo Petronzi
Tips & Tricks per l’integrazione con Salesforce - Luca Bonaldo
2. MuleSoft Meetup Milano – Paolo Umberto Petronzi, Software Architect
L'importanza del Testing
e la sua automazione
5. Introduzione
Tipi di test di maggior rilievo per le applicazioni Mule
1. Test Unitari
2. Test di Integrazione
3. Test sulle Prestazioni
6. Introduzione
Test Unitari
● Verificano il codice implementato
● Test focalizzati sulle singole unità logiche, porzioni atomiche di codice
● Indipendenti dalle interazioni con altri sistemi
○ Mock / Stub
● Implementati dallo sviluppatore insieme al codice
● Eseguiti durante la fase di build
● Output: Copertura %
● Transparent Box Testing
9. Introduzione
Test di Integrazione
● Verificano come l’applicazione interagisce con sistemi esterni
● Test focalizzati sulle funzionalità dell’applicazione
● Necessità di
○ rendere i test replicabili
○ un ambiente dedicato effimero
● Opaque Box Testing
10. Introduzione
Test sulle Prestazioni
● Misurano le prestazioni del sistema nella sua interezza
○ Tempo di risposta
○ Affidabilità
○ Utilizzo risorse
○ …
● Test focalizzati sulla verifica del dimensionamento del sistema
● Stress Tests, Soak Tests, Resiliency Tests
○ Capacità di Burst in CloudHub
● Opaque Box Testing
11. Introduzione
Vantaggi del Testing
Diretti
● Verifica soddisfazione requisiti
● Verifica di non regressione
● Verifica risoluzione di bug
● Automatizzabili
Indiretti
● Documentazione ‘attiva’
● Collaudi semplificati
12. Introduzione
Vantaggi del Testing
Diretti
● Verifica soddisfazione requisiti
● Verifica di non regressione
● Verifica risoluzione di bug
● Automatizzabili
Indiretti
● Documentazione ‘attiva’
● Collaudi semplificati
C4E
16. MUnit
Creazione di un nuovo Test in Anypoint Studio
A partire da un flusso o da Package Explorer
○ Creare un Test su un flusso
○ Creare un Test vuoto
○ Registrare un Test
27. Tips & Tricks
Naming Conventions & Packaging
● Nomi dei test parlanti
○ should-return-200-when-payload-is-not-null
○ should-raise-custom-error-when-result-code-is-null
● Non usare i nomi di default delle operazioni
○ Set Event, Flow Reference, Mock When, Assert That, ….
● Rispettare lo stesso packaging in src/main/mule
33. Conclusioni
Argomenti trattati
● Differenze tra i tipi di test
● Panoramica su MUnit
● Integrazione con Anypoint Studio
● Automatizzazione con Maven Plugin
● Suggerimenti per rendere più efficaci i Test MUnit
38. Goal
Integration with Salesforce
1. How to extract data from Salesforce - Connectivity Options
2. How to integrate external data into Salesforce
3. Integration Approaches – What’s the right one?
41. Salesforce APIs
API Name Protocol Data Format Communication
REST API REST JSON, XML Synchronous
SOAP API SOAP
(WSDL)
XML Synchronous
Chatter
REST API
REST JSON, XML Synchronous (photos are
processed asynchronously)
User
Interface
API
REST JSON Synchronous
Analytics
REST API
REST JSON, XML Synchronous
Bulk API REST CSV, JSON,
XML
Asynchronous
Metadata
API
SOAP
(WSDL)
XML Asynchronous
Streaming
API
Bayeux JSON Asynchronous (stream of
data)
Apex REST
API
REST JSON, XML,
Custom
Synchronous
Apex SOAP
API
SOAP
(WSDL)
XML Synchronous
Tooling API REST or
SOAP
(WSDL)
JSON, XML,
Custom
Synchronous
Mulesoft Standard Connector
supports 6 integration technologies
from SFDC Core:
- SOAP
- Bulk REST
- Streaming
- Metadata
- Apex SOAP
- Apex REST
42. Salesforce APIs
• REST API
– It exposes all sorts of Salesforce functionality via REST resources and HTTP
methods
– CRUD operations
– Search and Query operations to get object metadata
– Supports JSON and XML
– Great for mobile and web apps pulling data from SF
• SOAP API
– Offers the same functionality as REST API but exposed as a SOAP web
service
– Uses a WSDL file to define parameters and access
– Good for server-to-server integrations
Integration methods
43. Salesforce APIs
• STREAMING APIs
– It's a specialized API for setting up notifications that trigger when changes are made to
your data
– Uses a publish-subscribe model in which users can subscribe to channels that broadcast
certain types of data changes
– This model reduces the number of API requests by eliminating the need for polling.
– This is the preferred API for writing apps that would otherwise need to frequently poll
for changes.
• BULK API
– It's a specialized REST API for loading and querying lots of data at once
– Use for Query, Insert, Update,Upsert, or Delete for 10’s of thousands to millions of
records
– It's asynchronous --> you can submit the request and come back later for results
– This API is the preferred one when dealing with large amounts of data. Ex: loading data
into your org for the first time
– Two versions supported Bulk API 1.0 and 2.0
Integration methods
50. Contattaci all’indirizzo meetup@florence-
consulting.it
Hai ancora domande e vuoi
approfondire in separata sede?
Invia il tuo feedback
Finito l’evento riceverai una e-mail per inviare il
tuo feedback: facci sapere con precisione quali
sono i topic che ti piacerebbe approfondire
insieme!
We Are Hiring!