try {
EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
EdmEntityType edmEntityType = edmEntitySet.getEntityType();
jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
JPATypeMock jpaTypeMock = new JPATypeMock();
jpaEntity.setJPAEntity(jpaTypeMock);
jpaEntity.update(ODataEntryMockUtil.mockODataEntryProperties(JPATypeMock.ENTITY_NAME));
} catch (ODataJPARuntimeException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+ ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (EdmException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+ ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+ ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
assertEquals(jpaTypeMock.getMInt(), 0);// Key should not be changed
assertEquals(jpaTypeMock.getMString(), ODataEntryMockUtil.VALUE_MSTRING);
assertTrue(jpaTypeMock.getMDateTime().equals(ODataEntryMockUtil.VALUE_DATE_TIME));
}