4
* Copyright (c) 2010 Sonatype, Inc. All rights reserved.
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
package com.sonatype.matrix.smoothie.injecto;
27
import com.google.inject.Key;
28
import com.sonatype.matrix.smoothie.Smoothie;
29
import com.sonatype.matrix.smoothie.TestSupport;
30
import org.junit.Test;
32
import javax.inject.Named;
33
import javax.inject.Singleton;
35
import static org.junit.Assert.*;
38
* Tests for {@link InjectomaticAware}.
40
* @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
42
public class InjectomaticAwareTest
46
public void testInjectoAware() {
47
Injectomatic injecto = Smoothie.getContainer().get(Key.get(Injectomatic.class));
48
assertNotNull(injecto);
50
TestInjectomaticAware aware = Smoothie.getContainer().get(Key.get(TestInjectomaticAware.class));
51
assertNotNull(aware.injecto);
52
assertEquals(injecto, aware.injecto);
57
public static class TestInjectomaticAware
58
implements InjectomaticAware
62
public void setInjectomatic(Injectomatic injecto) {
63
this.injecto = injecto;
b'\\ No newline at end of file'