1 /* 2 * Copyright (c) 2017 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.internal.creation.bytebuddy; 6 7 import net.bytebuddy.dynamic.loading.ClassLoadingStrategy; 8 9 /** 10 * A subclass loader is responsible for resolving a class loading strategy for a mock that is implemented as a subclass. 11 */ 12 public interface SubclassLoader { 13 14 /** 15 * Resolves a class loading strategy. 16 * 17 * @param mockedType The type being mocked. 18 * @param classLoader The class loader being used. 19 * @param codegen {@code true} if the mock is loaded in the {@code org.mockito.codegen} package. 20 * @return An appropriate class loading strategy. 21 */ resolveStrategy(Class<?> mockedType, ClassLoader classLoader, boolean codegen)22 ClassLoadingStrategy<ClassLoader> resolveStrategy(Class<?> mockedType, ClassLoader classLoader, boolean codegen); 23 } 24