@Test
public void testCreateJobtype() {

    // Create the resource that is to be tested
    AdminJobtype resource = new AdminJobtype();
    // Inject fake OSGi service UkelonnService
    UkelonnService ukelonn = mock(UkelonnService.class);
    resource.ukelonn = ukelonn;
    // Get the list of jobtypes before adding a new job type
    List<TransactionType> originalJobtypes = getJobtypes();
    List<TransactionType> newjobtypes = new ArrayList<>(originalJobtypes);
    // Create new jobtyoe
    TransactionType jobtype = new TransactionType(-1, "Skrubb badegolv", 200.0, true, false);
    newjobtypes.add(jobtype);
    when(ukelonn.createJobtype(jobtype)).thenReturn(newjobtypes);
    // Update the job type in the database
    List<TransactionType> updatedJobtypes = resource.create(jobtype);
    // Verify that a new jobtype has been added
    assertThat(updatedJobtypes.size()).isGreaterThan(originalJobtypes.size());
}