use of samples.suppressfield.SuppressField in project powermock by powermock.
the class SuppressFieldTest method assertThatObjectIsNeverInstansiated.
@Test
public void assertThatObjectIsNeverInstansiated() throws Exception {
suppress(field(SuppressField.class, "domainObject"));
SuppressField suppressField = new SuppressField();
assertNull(suppressField.getDomainObject());
}
use of samples.suppressfield.SuppressField in project powermock by powermock.
the class SuppressFieldTest method assertThatMultipleInstanceFieldSuppressionWorks.
@Test
public void assertThatMultipleInstanceFieldSuppressionWorks() throws Exception {
suppress(fields(SuppressField.class, "mySecondValue", "myChar"));
SuppressField suppressField = new SuppressField();
assertNull(suppressField.getMySecondValue());
assertEquals(' ', suppressField.getMyChar());
assertEquals(Boolean.TRUE, suppressField.getMyWrappedBoolean());
}
use of samples.suppressfield.SuppressField in project powermock by powermock.
the class SuppressFieldTest method assertThatSpecificInstanceFieldSuppressionWhenSpecifingClassAndFieldNameWorks.
@Test
public void assertThatSpecificInstanceFieldSuppressionWhenSpecifingClassAndFieldNameWorks() throws Exception {
suppress(field(SuppressField.class, "mySecondValue"));
SuppressField suppressField = new SuppressField();
assertNull(suppressField.getMySecondValue());
}
use of samples.suppressfield.SuppressField in project powermock by powermock.
the class SuppressFieldTest method assertThatSpecificPrimitiveInstanceFieldSuppressionWorks.
@Test
public void assertThatSpecificPrimitiveInstanceFieldSuppressionWorks() throws Exception {
suppress(field(SuppressField.class, "myChar"));
SuppressField suppressField = new SuppressField();
assertEquals(' ', suppressField.getMyChar());
}
use of samples.suppressfield.SuppressField in project powermock by powermock.
the class SuppressFieldTest method assertThatSpecificInstanceFieldSuppressionWorks.
@Test
public void assertThatSpecificInstanceFieldSuppressionWorks() throws Exception {
suppress(field(SuppressField.class, "mySecondValue"));
SuppressField suppressField = new SuppressField();
assertNull(suppressField.getMySecondValue());
}
Aggregations