Search in sources :

Example 1 with EmployeeHours

use of com.objectcomputing.checkins.services.employee_hours.EmployeeHours in project check-ins by objectcomputing.

the class EmployeeHoursFixture method createEmployeeHours.

default List<EmployeeHours> createEmployeeHours() {
    final EmployeeHoursServices employeeHoursServices = null;
    File file = new File("src/test/java/com/objectcomputing/checkins/services/employee_hours/test.csv");
    MultipartBody multipartBody = MultipartBody.builder().addPart("file", "test.csv", new MediaType("text/csv"), file).build();
    List<EmployeeHours> employeeHoursList = new ArrayList<>();
    try {
        InputStream inputStream = new FileInputStream(file);
        employeeHoursList = EmployeeaHoursCSVHelper.employeeHrsCsv(inputStream);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
    return getEmployeeHoursRepository().saveAll(employeeHoursList);
}
Also used : EmployeeHours(com.objectcomputing.checkins.services.employee_hours.EmployeeHours) EmployeeHoursServices(com.objectcomputing.checkins.services.employee_hours.EmployeeHoursServices) MultipartBody(io.micronaut.http.client.multipart.MultipartBody) ArrayList(java.util.ArrayList) MediaType(io.micronaut.http.MediaType)

Aggregations

EmployeeHours (com.objectcomputing.checkins.services.employee_hours.EmployeeHours)1 EmployeeHoursServices (com.objectcomputing.checkins.services.employee_hours.EmployeeHoursServices)1 MediaType (io.micronaut.http.MediaType)1 MultipartBody (io.micronaut.http.client.multipart.MultipartBody)1 ArrayList (java.util.ArrayList)1