예제 #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());
  }
예제 #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());
 }
예제 #3
0
 @Test
 public void singletonAnnotationNotInheritedFromSupertype() {
   assertNotSame(car.driversSeatA, car.driversSeatB);
 }