@Test public void testUpdateGroup() throws Exception { TravelerGroupEntity group = endpoint.insert("Adventure", TEST_IMG, user); TravelerGroupEntity updated = endpoint.update(group.getWebsafeId(), "New Life", user); assertEquals("New Life", updated.getName()); }
public TravelerGroupEntity updateGroup(String groupId, Optional<String> name) { return Single .just(ofy().load().key(Key.<TravelerGroupEntity>create(groupId)).now()) .map(entity -> name.isPresent() ? entity.withName(name.get()) : entity) .doOnSuccess(entity -> ofy().save().entity(entity).now()) .blockingGet(); }
TravelerGroupController extends Controller { public TravelerGroupEntity updateGroup(String groupId, Optional<String> name) { return Single .just(ofy().load().key(Key.<TravelerGroupEntity>create(groupId)).now()) .map(entity -> name.isPresent() ? entity.withName(name.get()) : entity) .doOnSuccess(entity -> ofy().save().entity(entity).now()) .blockingGet(); } }
TravelerGroupController extends Controller { public TravelerGroupEntity updateGroup(String groupId, Optional<String> name) { return Single .just(ofy().load().key(Key.<TravelerGroupEntity>create(groupId)).now()) .map(entity -> name.isPresent() ? entity.withName(name.get()) : entity) .doOnSuccess(entity -> ofy().save().entity(entity).now()) .blockingGet(); }  }
TravelerGroupController extends Controller { public TravelerGroupEntity updateGroup(String groupId, Optional<String> name) { return Single .just(ofy().load().key(Key.<TravelerGroupEntity>create(groupId)).now()) .map(entity -> name.isPresent() ? entity.withName(name.get()) : entity) .doOnSuccess(entity -> ofy().save().entity(entity).now()) .blockingGet(); }  TravelerGroupEntity getGroup(@Nonnull String id, @Nonnull User user); TravelerGroupEntity insertGroup(String displayName, String imageName); TravelerGroupEntity updateGroup(String groupId, Optional<String> name); CollectionResponse<TravelerGroupEntity> listGroups(Optional<GroupSorter> sorter,
      Optional<Integer> limit, Optional<String> cursor, User user); CollectionResponse<Account> listGroupUsers(String groupId, Optional<Integer> limit,
      Optional<String> cursor); void subscribe(@Nonnull String groupId, @Nonnull User user); void unsubscribe(@Nonnull String groupId, @Nonnull User user); Collection<TravelerGroupEntity> listSubscribedGroups(@Nonnull String userId); Collection<TravelerGroupEntity> searchGroups(@Nonnull String q); void setup(); void setupDev(); }
TravelerGroupController extends Controller { public TravelerGroupEntity updateGroup(String groupId, Optional<String> name) { return Single .just(ofy().load().key(Key.<TravelerGroupEntity>create(groupId)).now()) .map(entity -> name.isPresent() ? entity.withName(name.get()) : entity) .doOnSuccess(entity -> ofy().save().entity(entity).now()) .blockingGet(); }  TravelerGroupEntity getGroup(@Nonnull String id, @Nonnull User user); TravelerGroupEntity insertGroup(String displayName, String imageName); TravelerGroupEntity updateGroup(String groupId, Optional<String> name); CollectionResponse<TravelerGroupEntity> listGroups(Optional<GroupSorter> sorter,
      Optional<Integer> limit, Optional<String> cursor, User user); CollectionResponse<Account> listGroupUsers(String groupId, Optional<Integer> limit,
      Optional<String> cursor); void subscribe(@Nonnull String groupId, @Nonnull User user); void unsubscribe(@Nonnull String groupId, @Nonnull User user); Collection<TravelerGroupEntity> listSubscribedGroups(@Nonnull String userId); Collection<TravelerGroupEntity> searchGroups(@Nonnull String q); void setup(); void setupDev();  }