use of org.apache.deltaspike.data.test.domain.Simple in project deltaspike by apache.
the class FullEntityRepositoryTest method should_save_with_merge_abstract.
@Test
public void should_save_with_merge_abstract() throws Exception {
// given
Simple simple = testData.createSimple("testMerge");
Long id = simple.getId();
// when
final String newName = "testMergeUpdated";
simple.setName(newName);
simple = repoAbstract.save(simple);
// then
assertEquals(id, simple.getId());
assertEquals(newName, simple.getName());
}
use of org.apache.deltaspike.data.test.domain.Simple in project deltaspike by apache.
the class FullEntityRepositoryTest method should_find_by_criteria.
@Test
public void should_find_by_criteria() throws Exception {
// given
Simple simple = new Simple("criteria");
// when
simple = repoAbstract.saveAndFlush(simple);
Simple fetch = repoAbstract.fetchByName("criteria");
// then
assertEquals(simple.getId(), fetch.getId());
}
use of org.apache.deltaspike.data.test.domain.Simple in project deltaspike by apache.
the class FullEntityRepositoryTest method should_save_with_merge.
@Test
public void should_save_with_merge() throws Exception {
// given
Simple simple = testData.createSimple("testMerge");
Long id = simple.getId();
// when
final String newName = "testMergeUpdated";
simple.setName(newName);
simple = repo.save(simple);
// then
assertEquals(id, simple.getId());
assertEquals(newName, simple.getName());
}
use of org.apache.deltaspike.data.test.domain.Simple in project deltaspike by apache.
the class QueryHandlerTest method should_create_query_delete_by_method_name_with_multiply_params.
@Test
public void should_create_query_delete_by_method_name_with_multiply_params() {
// given
final String name = "testCreateQueryByMethodName";
builder.createSimple(name);
// when
repo.deleteByNameAndEnabled(name, Boolean.TRUE);
repo.flush();
Simple result = repo.findAnyByName(name);
// then
assertNull(result);
}
use of org.apache.deltaspike.data.test.domain.Simple in project deltaspike by apache.
the class QueryHandlerTest method should_create_query_delete_by_method_name.
@Test
public void should_create_query_delete_by_method_name() {
// given
final String name = "testCreateQueryByMethodName";
builder.createSimple(name);
// when
repo.deleteByName(name);
repo.flush();
Simple result = repo.findAnyByName(name);
// then
assertNull(result);
}
Aggregations