Package com.getperka.flatpack.domain

Examples of com.getperka.flatpack.domain.Employee


  /**
   * Just make sure the test resolver is capturing data correctly.
   */
  @Test
  public void testWiring() throws IOException {
    Employee e = makeEmployee();
    Employee e2 = deepPack(Employee.class, e);

    assertSame(e, e2);
  }
View Full Code Here


  private final Map<UUID, HasUuid> data = FlatPackCollections.mapForLookup();

  @Test
  public void test() throws IOException {
    Employee e1 = makeEmployee();
    Employee e2 = makeEmployee();
    String e2Name = e2.getName();

    Employee e1Send = makeEmployee();
    e1Send.setUuid(e1.getUuid());
    e1Send.setName("Should see this");

    Employee e2Send = makeEmployee();
    e2Send.setUuid(e2.getUuid());
    e2Send.setName("Should not see this");

    data.put(e1.getUuid(), e1);
    data.put(e2.getUuid(), e2);

    // Update self
    Employee updated = deepPack(Employee.class, e1Send, new TestPrincipal(e1.getUuid()));
    assertEquals("Should see this", updated.getName());

    // Try updating one employee as another
    updated = deepPack(Employee.class, e2Send, new TestPrincipal(e1.getUuid()));
    assertEquals(e2Name, updated.getName());
  }
View Full Code Here

TOP

Related Classes of com.getperka.flatpack.domain.Employee

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.