Package org.assertj.core.test

Examples of org.assertj.core.test.Employee


  private List<Employee> employees;
  private FieldSupport fieldSupport = FieldSupport.instance();

  @Before
  public void setUpOnce() {
  yoda = new Employee(1L, new Name("Yoda"), 800);
  luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
  employees = newArrayList(yoda, luke);
  }
View Full Code Here


  private Employee luke;
  private Iterable<Employee> employees;

  @Before
  public void setUpOnce() {
    yoda = new Employee(6000L, new Name("Yoda"), 800);
    luke = new Employee(8000L, new Name("Luke", "Skywalker"), 26);
    employees = newArrayList(yoda, luke);
  }
View Full Code Here

  private Employee luke;
  private List<Employee> employees;

  @Before
  public void setUp() {
    yoda = new Employee(1L, new Name("Yoda"), 800);
    yoda.surname = new Name("Master", "Jedi");
    luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
    employees = newArrayList(yoda, luke);
  }
View Full Code Here

  private Employee luke;
  private List<Employee> employees;

  @Before
  public void setUp() {
    yoda = new Employee(1L, new Name("Yoda"), 800);
    yoda.surname = new Name("Master", "Jedi");
    luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
    employees = newArrayList(yoda, luke);
  }
View Full Code Here

  }

  // --
 
  private Employee employeeWithBrokenName(String name) {
    return new Employee(1L, new Name(name), 0){
     
      @Override
      public Name getName() {
        throw new IllegalStateException();
      }
View Full Code Here

      }
    };
  }
 
  private Employee employeeWithOverridenName(final String overridenName) {
    return new Employee(1L, new Name("Name"), 0){
     
      @Override
      public Name getName() {
        return new Name(overridenName);
      }
View Full Code Here

      }
    };
  }

  private Employee brokenEmployee() {
    return new Employee(){
     
      @Override
      public boolean isAdult() {
        throw new IllegalStateException();
      }
View Full Code Here

  private ToStringExtractor toStringExtractor = new ToStringExtractor();
 
  @Test
  public void should_extract_toString() throws Exception {
    Employee someEmloyee = new Employee(1, new Name("John Doe"), 28);
   
    String result = toStringExtractor.extract(someEmloyee);
   
    assertThat(result).isEqualTo("Employee[id=1, name=Name[first='John Doe', last='null'], age=28]");
  }
View Full Code Here

  @Test
  public void should_throw_exception_if_property_cannot_be_extracted_due_to_runtime_exception_during_property_access()
      throws Exception {
    thrown.expect(IntrospectionError.class);

    Employee employee = brokenEmployee();
    adultExtractor().extract(employee);
  }
View Full Code Here

    idExtractor().extract(null);
  }

  private Employee employeeWithBrokenName(String name) {
    return new Employee(1L, new Name(name), 0) {

      @Override
      public Name getName() {
        throw new IllegalStateException();
      }
View Full Code Here

TOP

Related Classes of org.assertj.core.test.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.