Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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