### Question:
Repository implements RepositoryApi { @Override public <T> T save(T object) { logger.finer("saving object"); namespace.set(object.getClass()); try { RepositoryHooks.beforeSave(this, object); saveInternal(object); RepositoryHooks.afterSave(this, object); } finally { namespace.reset(); } return object; } private  Repository(); private  Repository(String ns); static Repository r(); static Repository r(String ns); @Override Repository namespace(String ns); @Override Namespace namespace(); @Override String currentNamespace(); @Override Repository setFeatures(RepositoryFeatures repositoryFeatures); @Override Repository setRequestContext(RequestContext requestContext); @Override Driver driver(); @Override AsyncRepository async(); @Override T save(T object); @Override T fetch(IdRef<T> id); @Override FutureObject<T> fetchAsync(IdRef<T> id); @Override Object action(IdRef<?> id, Class<?> clazz, ActionKey actionKey, String json, Map<String, String> params); @Override QueryBuilder<T> query(Class<T> clazz); @Override void destroy(IdRef<?> id); @Override Class<?> getClazzByKind(String kind); @Override @SuppressWarnings("unchecked") EndpointFeatures<T> getEndpointFeatures(Class<T> endpoint); @Override EndpointFeatures<?> getEndpointFeatures(String endpointPath); @Override RepositoryFeatures getFeatures(); @Override IdRef<T> parseId(Class<T> clazz, String idString); @Override List<IdRef<T>> parseIds(Class<T> clazz, List<String> idsString); @Override void begin(); @Override void beginX(); @Override void rollback(); @Override void commit(); @Override boolean isTransactionInProgress(); @Override TransactionDriver currentTransaction(); @Override RequestContext getRequestContext();  }### Answer:
@Test public void testSaveWithEnum() { BasicObject object = new BasicObject(); object.setStatus(Status.RUNNING); yawp.save(object); BasicObject retrievedObject = yawp(BasicObject.class).first(); assertEquals(Status.RUNNING, retrievedObject.getStatus()); }
@Test public void testQueryWithEnum() { BasicObject object = new BasicObject(); object.setStatus(Status.RUNNING); yawp.save(object); BasicObject retrievedObject = yawp(BasicObject.class).where("status", "=", Status.RUNNING).first(); assertEquals(Status.RUNNING, retrievedObject.getStatus()); }
@Test public void testSaveForNotEndpointObjects() { NotEndpointObject object = new NotEndpointObject("xpto"); object.setParentId(id(BasicObject.class, 1L)); yawp.save(object); NotEndpointObject retrievedObject = yawp(NotEndpointObject.class).only(); assertEquals("xpto", retrievedObject.getName()); assertEquals(id(BasicObject.class, 1L), retrievedObject.getParentId()); }