@Test public void testThatOrganizationIsRenamed() { final OrganizationState state = Organization.sourcedWith(grid, DefaultName, DefaultDescription) .andThenTo(s -> grid.actorOf(Organization.class, address(s.id()))) .andThenTo(organization -> organization.renameTo(DefaultName + 1)) .await(); Assert.assertEquals(DefaultName + 1, state.name()); }
@Override public Completes<OrganizationState> renameTo(final String name) { return apply(new OrganizationRenamed(state.organizationId, name), () -> state); }
OrganizationEntity extends EventSourced implements Organization { @Override public Completes<OrganizationState> renameTo(final String name) { return apply(new OrganizationRenamed(state.organizationId, name), () -> state); } }
OrganizationEntity extends EventSourced implements Organization { @Override public Completes<OrganizationState> renameTo(final String name) { return apply(new OrganizationRenamed(state.organizationId, name), () -> state); } OrganizationEntity(final Id organizationId);  OrganizationEntity(); }
OrganizationEntity extends EventSourced implements Organization { @Override public Completes<OrganizationState> renameTo(final String name) { return apply(new OrganizationRenamed(state.organizationId, name), () -> state); } OrganizationEntity(final Id organizationId);  OrganizationEntity(); @Override Completes<OrganizationState> defineWith(final String name, final String description); @Override Completes<OrganizationState> enable(); @Override Completes<OrganizationState> disable(); @Override Completes<OrganizationState> describeAs(final String description); @Override Completes<OrganizationState> renameTo(final String name); }
OrganizationEntity extends EventSourced implements Organization { @Override public Completes<OrganizationState> renameTo(final String name) { return apply(new OrganizationRenamed(state.organizationId, name), () -> state); } OrganizationEntity(final Id organizationId);  OrganizationEntity(); @Override Completes<OrganizationState> defineWith(final String name, final String description); @Override Completes<OrganizationState> enable(); @Override Completes<OrganizationState> disable(); @Override Completes<OrganizationState> describeAs(final String description); @Override Completes<OrganizationState> renameTo(final String name);  }