use of org.junit.Before in project cas by apereo.
the class TicketsResourceTests method setUp.
@Before
public void setUp() throws Exception {
final AuthenticationManager mgmr = mock(AuthenticationManager.class);
when(mgmr.authenticate(any(AuthenticationTransaction.class))).thenReturn(CoreAuthenticationTestUtils.getAuthentication());
when(ticketSupport.getAuthenticationFrom(anyString())).thenReturn(CoreAuthenticationTestUtils.getAuthentication());
this.ticketsResourceUnderTest = new TicketsResource(new DefaultAuthenticationSystemSupport(new DefaultAuthenticationTransactionManager(mgmr), new DefaultPrincipalElectionStrategy()), new DefaultCredentialFactory(), ticketSupport, new WebApplicationServiceFactory(), casMock);
this.mockMvc = MockMvcBuilders.standaloneSetup(this.ticketsResourceUnderTest).defaultRequest(get("/").contextPath("/cas").contentType(MediaType.APPLICATION_FORM_URLENCODED)).build();
}
use of org.junit.Before in project bazel by bazelbuild.
the class WorkspaceASTFunctionTest method setUp.
@Before
public final void setUp() throws Exception {
ConfiguredRuleClassProvider ruleClassProvider = TestRuleClassProvider.getRuleClassProvider();
ConfiguredRuleClassProvider ruleClassProviderSpy = Mockito.spy(ruleClassProvider);
// Prevent returning default workspace file.
Mockito.when(ruleClassProviderSpy.getDefaultWorkspacePrefix()).thenReturn("");
Mockito.when(ruleClassProviderSpy.getDefaultWorkspaceSuffix()).thenReturn("");
astSkyFunc = new WorkspaceASTFunction(ruleClassProviderSpy);
fakeWorkspaceFileValue = new FakeFileValue();
}
use of org.junit.Before in project android-gif-drawable by koral--.
the class ConditionVariableTest method setUp.
@Before
public void setUp() {
conditionVariable = new ConditionVariable();
waiter = new Waiter();
}
use of org.junit.Before in project marine-api by ktuukkan.
the class DateTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
instance = new Date();
cal = new GregorianCalendar();
}
use of org.junit.Before in project marine-api by ktuukkan.
the class HeadingProviderTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
factory = SentenceFactory.getInstance();
File file = new File("target/test-classes/data/sample1.txt");
FileInputStream str = new FileInputStream(file);
SentenceReader r = new SentenceReader(str);
instance = new HeadingProvider(r);
instance.addListener(this);
event = null;
}
Aggregations