Esempio n. 1
0
  @Test
  public void testCreate() throws Exception {

    Map<String, String> values = new HashMap<>();
    values.put("payCode", "PSC03");
    values.put("receiverCode", "SC03");
    PayRoll payRoll = PayRollFactory.createPayRoll(20000.00, values);
    repository.save(payRoll);
    code = payRoll.getPayCode();
    Assert.assertNotNull(payRoll.getPayCode());
  }
Esempio n. 2
0
  @Test
  public void testUpdate() throws Exception {

    PayRoll payRoll = repository.findBypayCode("PSC03");
    Map<String, String> values = new HashMap<>();
    values.put("payCode", "PSC04");
    values.put("receiverCode", "SC04");
    PayRoll newPayRoll = PayRollFactory.createPayRoll(10000.00, values);
    repository.delete(payRoll);
    repository.save(newPayRoll);
    Assert.assertNotEquals("PSC04", payRoll.getPayCode());
    Assert.assertNotEquals(10000.00, payRoll.getAmount());
  }