@Test(expected = NotFoundException.class) @Transactional public void testSetTransientPropertyFieldNotManaged() { Person p = new Person("Michael", 35); p.setThought("food"); p.getUnderlyingState().getProperty("Person.thought"); }
@Test @Transactional public void testGetTransientPropertyFieldNotManaged() { Person p = new Person("Michael", 35); p.setThought("food"); p.getUnderlyingState().setProperty("Person.thought", "sleep"); assertEquals("Should not have read transient value from graph.", "food", p.getThought()); }
@Test @Transactional public void testGetPropertyEnum() { Person p = new Person("Michael", 35); p.getUnderlyingState().setProperty("Person.personality", "EXTROVERT"); assertEquals( "Did not deserialize property value properly.", Personality.EXTROVERT, p.getPersonality()); }
@Test @Transactional public void testSetPropertyEnum() { Person p = new Person("Michael", 35); p.setPersonality(Personality.EXTROVERT); assertEquals( "Wrong enum serialization.", "EXTROVERT", p.getUnderlyingState().getProperty("Person.personality")); }
@Test @Transactional public void testEntityIdField() { Person p = new Person("Michael", 35); assertEquals("Wrong ID.", p.getUnderlyingState().getId(), p.getId()); }