Search in sources :

Example 66 with Before

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();
}
Also used : AuthenticationManager(org.apereo.cas.authentication.AuthenticationManager) DefaultPrincipalElectionStrategy(org.apereo.cas.authentication.DefaultPrincipalElectionStrategy) WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) DefaultAuthenticationSystemSupport(org.apereo.cas.authentication.DefaultAuthenticationSystemSupport) AuthenticationTransaction(org.apereo.cas.authentication.AuthenticationTransaction) DefaultAuthenticationTransactionManager(org.apereo.cas.authentication.DefaultAuthenticationTransactionManager) Before(org.junit.Before)

Example 67 with Before

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();
}
Also used : ConfiguredRuleClassProvider(com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider) FakeFileValue(com.google.devtools.build.lib.skyframe.WorkspaceFileFunctionTest.FakeFileValue) Before(org.junit.Before)

Example 68 with Before

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();
}
Also used : Waiter(net.jodah.concurrentunit.Waiter) Before(org.junit.Before)

Example 69 with Before

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();
}
Also used : GregorianCalendar(java.util.GregorianCalendar) Before(org.junit.Before)

Example 70 with Before

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;
}
Also used : SentenceReader(net.sf.marineapi.nmea.io.SentenceReader) File(java.io.File) FileInputStream(java.io.FileInputStream) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)10105 File (java.io.File)829 Properties (java.util.Properties)286 Configuration (org.apache.hadoop.conf.Configuration)282 ArrayList (java.util.ArrayList)256 TreeMap (java.util.TreeMap)247 HashMap (java.util.HashMap)196 IOException (java.io.IOException)175 URL (java.net.URL)167 Path (org.apache.hadoop.fs.Path)144 TableHelper (org.apache.cayenne.test.jdbc.TableHelper)132 InputStream (java.io.InputStream)119 Config (com.hazelcast.config.Config)115 HazelcastInstance (com.hazelcast.core.HazelcastInstance)111 InvocationOnMock (org.mockito.invocation.InvocationOnMock)111 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)106 Date (java.util.Date)105 ByteArrayOutputStream (java.io.ByteArrayOutputStream)96 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)90 Random (java.util.Random)82