@Test
public void testRegisterPayment() throws Exception {

    // Create the request
    Account account = getJadAccount();
    double originalBalance = account.getBalance();
    account.setBalance(0.0);
    List<TransactionType> paymenttypes = getPaymenttypes();
    PerformedTransaction payment = new PerformedTransaction(account, paymenttypes.get(0).getId(), account.getBalance(), new Date());
    // Create the object to be tested
    RegisterPayment resource = new RegisterPayment();
    // Inject fake OSGi service UkelonnService
    UkelonnService ukelonn = mock(UkelonnService.class);
    when(ukelonn.registerPayment(any())).thenReturn(account);
    resource.ukelonn = ukelonn;
    // Run the method under test
    Account result = resource.doRegisterPayment(payment);
    // Check the response
    assertEquals("jad", result.getUsername());
    assertThat(result.getBalance()).isLessThan(originalBalance);
}