Durante l'ottavo Meetup di Milano, tenutosi il 19 Maggio dalle ore 10:30, si è potuto approfondire con Paolo Petronzi tutte le metodologie di testing e automazione con MUnit, invce con Luca Bonaldo, il nostro Mulesoft Mentor in Italia, c'è stato un focus sull'integrazione con Salesforce.
1. 19 Maggio 2022
Milano MuleSoft Meetup #8
Metodologie di testing e automazione con MUnit
Integrazione con SalesForce
2. IL TEAM DI MILANO MULESOFT MEETUP #8
Speakers
Caterina Bonanno Giacomo Bartoloni
Luca Bonaldo
Software Developer
Banca Popolare Etica
Gonzalo Marcos
We Are Hiring!
Paolo Petronzi
Software Architect
Florence Consulting
3. ● Ckeck-In e Benvenuto
● L'importanza del Testing e la sua automazione
● Tips & Tricks per l'integrazione con Salesforce
● Q&A and Wrap Up
Agenda
meetup@florence-consulting.it
7. 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?
10. 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
11. 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
12. 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
22. Introduzione
Tipi di test di maggior rilievo per le applicazioni Mule
1. Test Unitari
2. Test di Integrazione
3. Test sulle Prestazioni
23. 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
26. 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
27. 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
28. Introduzione
Vantaggi del Testing
Diretti
● Verifica soddisfazione requisiti
● Verifica di non regressione
● Verifica risoluzione di bug
● Automatizzabili
Indiretti
● Documentazione ‘attiva’
● Collaudi semplificati
29. Introduzione
Vantaggi del Testing
Diretti
● Verifica soddisfazione requisiti
● Verifica di non regressione
● Verifica risoluzione di bug
● Automatizzabili
Indiretti
● Documentazione ‘attiva’
● Collaudi semplificati
C4E
33. 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
44. 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
50. 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
52. 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!