Ejemplo n.º 1
0
  @Before
  public void setUp() throws Exception {

    client = new Client();
    client.setName("test");
    client.setAuditFlag("C");
    client.setCreatedBy(0);
    client.setCreatedTimeStamp(Calendar.getInstance().getTime());
  }
Ejemplo n.º 2
0
  @Test
  public void testFindByIdWithClientServiceShouldPass() throws Exception {

    client.setName("test findById");
    clientService.create(client);
    Integer insertedId = client.getId();

    Client result = clientService.findById(insertedId);

    assertThat(result.getName(), is("test findById"));
  }
Ejemplo n.º 3
0
  @Test
  public void testDeleteWithClientServiceShouldPass() throws Exception {

    clientService.create(client);
    Integer insertedId = client.getId();

    Client delete = clientService.findById(insertedId);
    clientService.delete(delete);

    Client result = clientService.findById(delete.getId());

    assertNull(result);
  }