๐ฏ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.ichwan.message; | |
| import io.gatling.javaapi.core.*; | |
| import io.gatling.javaapi.http.*; | |
| import static io.gatling.javaapi.core.CoreDsl.*; | |
| import static io.gatling.javaapi.http.HttpDsl.*; | |
| public class SalesforceAccountSimulation extends Simulation { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global class EmailScheduler implements Schedulable { | |
| global void execute(SchedulableContext sc) { | |
| OrgWideEmailAddress[] owea = [SELECT Id FROM OrgWideEmailAddress WHERE Address = 'myemail@gmail.com']; | |
| User usr = [SELECT Id, Name FROM User WHERE Id =:UserInfo.getUserId() LIMIT 1]; | |
| EmailTemplate emailTemplate = [SELECT Id, Name, HtmlValue, Subject, Body FROM EmailTemplate WHERE Name = 'Notification Scheduler']; | |
| String body = emailTemplate.HtmlValue.replace('[username]',usr.Name); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PicklistController { | |
| public static Map<Object, List<String>> picklistDependentValue(String sObjectName, String fieldName) { | |
| String base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
| Map<Object, List<String>> dependentPicklistMap = new Map<Object, List<String>>(); | |
| Schema.SObjectField dependFieldName = Schema.getGlobalDescribe().get(sObjectName).getDescribe().fields.getMap().get(fieldName); | |
| Schema.DescribeFieldResult dependentField = dependFieldName.getDescribe(); | |
| if (dependentField.getController() == null) return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.quarkus.hibernate.orm.panache.PanacheRepository; | |
| import jakarta.enterprise.context.ApplicationScoped; | |
| import java.util.List; | |
| @ApplicationScoped | |
| public class StudentRepository implements PanacheRepository<Student> { | |
| public List<Student> cumlaudeStudents(Double gpa) { | |
| return list("SELECT s FROM Student s WHERE s.gpa > ?1", gpa); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import jakarta.persistence.Column; | |
| import jakarta.persistence.Entity; | |
| import jakarta.persistence.GeneratedValue; | |
| import jakarta.persistence.Id; | |
| import lombok.AllArgsConstructor; | |
| import lombok.Data; | |
| import lombok.NoArgsConstructor; | |
| @Data | |
| @AllArgsConstructor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.quarkus.hibernate.orm.panache.PanacheEntity; | |
| import jakarta.persistence.Column; | |
| import jakarta.persistence.Entity; | |
| import jakarta.persistence.Table; | |
| @Entity | |
| public class Book extends PanacheEntity { | |
| @Column(length = 100) | |
| public String title; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ExtendWith(MockitoExtension.class) | |
| class PersonServiceTest { | |
| @Mock | |
| private PersonRepository repository; | |
| private PersonService service; | |
| @BeforeEach | |
| void setUp(){ | |
| service = new PersonService(repository); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PersonService { | |
| private PersonRepository repository; | |
| public PersonService(PersonRepository repository) { | |
| this.repository = repository; | |
| } | |
| public Person getById(String id){ | |
| Person person = repository.findById(id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface PersonRepository { | |
| Person findById(String id); | |
| void insert(Person person); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Person { | |
| private String id; | |
| private String name; | |
| public Person(String id, String name) { | |
| this.id = id; | |
| this.name = name; | |
| } |
NewerOlder