/* * Copyright (c) 2017 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockitousage.bugs; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.spy; public class ImplementationOfGenericAbstractMethodNotInvokedOnSpyTest { public abstract class GenericAbstract { protected abstract String method_to_implement(T value); public String public_method(T value) { return method_to_implement(value); } } public class ImplementsGenericMethodOfAbstract extends GenericAbstract { @Override protected String method_to_implement(T value) { return "concrete value"; } } @Test public void should_invoke_method_to_implement() { GenericAbstract spy = spy(new ImplementsGenericMethodOfAbstract()); assertThat(spy.public_method(73L)).isEqualTo("concrete value"); } }