Creating skeleton tests
What are skeleton tests, how to get them and how can they help when using Diffblue Cover?
public class DatabaseDao {
public static class Inner {
private Inner() {
}
public void myMethod(Inner inner) {
}
}
}/**
* Method under test: {@link DatabaseDao.Inner#myMethod(DatabaseDao.Inner)}
*/
@Test
@Disabled("TODO: Complete this test")
void testInnerMyMethod() {
// TODO: Complete this test.
// Reason: R008 Failed to instantiate class under test.
// Diffblue Cover was unable to construct an instance of DatabaseDao.Inner.
// Add a package-visible constructor or a factory method for the class under test.
// If such a method is already present but Diffblue Cover does not find it, it can
// be specified using custom rules for inputs:
// https://docs.diffblue.com/knowledge-base/cli/custom-inputs/
// This can happen because the factory method takes arguments, throws, returns null
// or returns a subtype.
// See https://diff.blue/R008
// Arrange
// TODO: Populate arranged inputs
DatabaseDao.Inner inner = null;
DatabaseDao.Inner inner1 = null;
// Act
inner.myMethod(inner1);
// Assert
// TODO: Add assertions on result
}Last updated
Was this helpful?

