1e0ae5d7e87b1dd6e789803c1b9615a84bd7488b7Ian Parkinson/*
2e0ae5d7e87b1dd6e789803c1b9615a84bd7488b7Ian Parkinson * Copyright (c) 2007 Mockito contributors
3e0ae5d7e87b1dd6e789803c1b9615a84bd7488b7Ian Parkinson * This program is made available under the terms of the MIT License.
4e0ae5d7e87b1dd6e789803c1b9615a84bd7488b7Ian Parkinson */
52637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffinpackage org.mockito.internal.configuration.injection.filter;
62637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin
72637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin/**
82637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin * Allow the ongoing injection of a mock candidate.
92637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin */
102637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffinpublic interface OngoingInjector {
112637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin
122637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    /**
132637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * Inject the mock.
142637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *
152637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * <p>
162637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * Please check the actual implementation.
172637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * </p>
182637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *
192637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * @return the mock that was injected, <code>null</code> otherwise.
202637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     */
212637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    Object thenInject();
222637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin
232637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    /**
242637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * Injector that will do nothing, and will return <code>null</code> as no mocks will be injected
252637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     */
262637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    OngoingInjector nop = new OngoingInjector() {
272637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin        public Object thenInject() {
282637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin            return null;
292637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin        }
302637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    };
312637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin}
32