According to the JavaDoc of fullyInitialized, each and every field that otherwise stays null should be initialized.
Having the SUT
public class Foo {
String foo;
String bar;
}
and the test class
public class FooTest {
@Tested(fullyInitialized = true)
Foo sut;
@Injectable("bam")
String bam;
@Injectable("baz")
String baz;
@Test
public void test() {
System.out.println(sut.foo);
System.out.println(sut.bar);
}
}
no field gets filled, though two type-matching injectables are found.
With the test class
public class FooTest {
@Tested(fullyInitialized = true)
Foo sut;
@Injectable("bam")
String bam;
@Injectable("bar")
String bar;
@Test
public void test() {
System.out.println(sut.foo);
System.out.println(sut.bar);
}
}
only the bar field is filled.
With the test class
public class FooTest {
@Tested(fullyInitialized = true)
Foo sut;
@Injectable("foo")
String foo;
@Injectable("baz")
String baz;
@Test
public void test() {
System.out.println(sut.foo);
System.out.println(sut.bar);
}
}
only the foo field is filled.
With the test class
public class FooTest {
@Tested(fullyInitialized = true)
Foo sut;
@Injectable("foo")
String foo;
@Injectable("bar")
String bar;
@Test
public void test() {
System.out.println(sut.foo);
System.out.println(sut.bar);
}
}
both fields are filled.
According to the JavaDoc of
fullyInitialized, each and every field that otherwise staysnullshould be initialized.Having the SUT
and the test class
no field gets filled, though two type-matching injectables are found.
With the test class
only the
barfield is filled.With the test class
only the
foofield is filled.With the test class
both fields are filled.