jeudi 7 juillet 2016

TestNG mocking static block

I am trying to test class, but there is static block and I need somehow to get rid of it because I don't actually need it.

public class ManagerI implements MInternal {

private static final AED aed;
private static final Logger logger = LoggerFactory.getLogger(ManagerI.class);

static {
    aed = AED.getInstance(LCED.getInstance());
    logger.info("text");
    methodCall();
    logger.info("test");
}

Is there any way to do this. Only refactoring?

Aucun commentaire:

Enregistrer un commentaire