Exemplo n.º 1
0
  @Test
  public void constructorInjectedProviderYieldsDistinctValues() {
    Provider<Seat> p1 = getField(car, "constructorDriversSeatProvider");
    assertNotSame(p1.get(), p1.get());

    Provider<Tire> p2 = getField(car, "constructorPlainTireProvider");
    assertNotSame(p2.get(), p2.get());

    Provider<Tire> p3 = getField(car, "constructorSpareTireProvider");
    assertNotSame(p3.get(), p3.get());
  }
Exemplo n.º 2
0
 @Test
 public void fieldInjectedProviderYieldsDistinctValues() {
   assertNotSame(car.fieldDriversSeatProvider.get(), car.fieldDriversSeatProvider.get());
   assertNotSame(car.fieldPlainTireProvider.get(), car.fieldPlainTireProvider.get());
   assertNotSame(car.fieldSpareTireProvider.get(), car.fieldSpareTireProvider.get());
 }
Exemplo n.º 3
0
 @Test
 public void singletonAnnotationNotInheritedFromSupertype() {
   assertNotSame(car.driversSeatA, car.driversSeatB);
 }