Search in sources :

Example 1 with PersonService

use of com.khartec.waltz.service.person.PersonService in project waltz by khartec.

the class PersonDataGenerator method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    PersonService personService = ctx.getBean(PersonService.class);
    PersonHierarchyService personHierarchyService = ctx.getBean(PersonHierarchyService.class);
    Person person = fairy.person();
    ImmutablePerson root = ImmutablePerson.builder().employeeId(person.getPassportNumber()).personKind(PersonKind.EMPLOYEE).userPrincipalName(person.getUsername()).title(randomPick(jobTitles[0])).departmentName("CEO").displayName(person.getFullName()).email(person.getEmail()).build();
    peeps.add(root);
    visit(root, 1);
    System.out.println(peeps.size());
    personService.bulkSave(peeps);
    personHierarchyService.build();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) PersonHierarchyService(com.khartec.waltz.service.person_hierarchy.PersonHierarchyService) PersonService(com.khartec.waltz.service.person.PersonService) ImmutablePerson(com.khartec.waltz.model.person.ImmutablePerson) ImmutablePerson(com.khartec.waltz.model.person.ImmutablePerson) Person(io.codearte.jfairy.producer.person.Person)

Aggregations

ImmutablePerson (com.khartec.waltz.model.person.ImmutablePerson)1 PersonService (com.khartec.waltz.service.person.PersonService)1 PersonHierarchyService (com.khartec.waltz.service.person_hierarchy.PersonHierarchyService)1 Person (io.codearte.jfairy.producer.person.Person)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1