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