Skip to content

Instantly share code, notes, and snippets.

@jangalinski
Created February 12, 2014 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jangalinski/8952249 to your computer and use it in GitHub Desktop.
Save jangalinski/8952249 to your computer and use it in GitHub Desktop.
package org.needle4j.injection;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.needle4j.annotation.InjectIntoMany;
import org.needle4j.annotation.ObjectUnderTest;
import org.needle4j.junit.NeedleBuilders;
import org.needle4j.junit.NeedleRule;
public class ShouldNotInjectStringTest {
public static class InjectionTargetBean {
private String doNotInjectThis;
public String getDoNotInjectThis() {
return doNotInjectThis;
}
}
@Rule
public NeedleRule needleRule = NeedleBuilders.needleMockitoRule().build();
@ObjectUnderTest
private InjectionTargetBean injectionTargetBean;
@InjectIntoMany
private String injectThis = "injectThis";
@Test
public void testInjection() {
Assert.assertNull(injectionTargetBean.getDoNotInjectThis());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment