Search in sources :

Example 26 with HeisenbergExtension

use of org.mule.test.heisenberg.extension.HeisenbergExtension in project mule by mulesoft.

the class DynamicConfigurationProviderTestCase method makeAlternateInstance.

private HeisenbergExtension makeAlternateInstance() throws Exception {
    ResolverSetResult alternateResult = mock(ResolverSetResult.class, Mockito.RETURNS_DEEP_STUBS);
    when(alternateResult.asMap()).thenReturn(new HashMap<>());
    mockConfigurationInstance(configurationModel, MODULE_CLASS.newInstance());
    when(resolverSet.resolve(from(event))).thenReturn(alternateResult);
    return (HeisenbergExtension) provider.get(event).getValue();
}
Also used : HeisenbergExtension(org.mule.test.heisenberg.extension.HeisenbergExtension) ResolverSetResult(org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSetResult)

Example 27 with HeisenbergExtension

use of org.mule.test.heisenberg.extension.HeisenbergExtension in project mule by mulesoft.

the class ReflectiveMethodOperationExecutorTestCase method initHeisenberg.

private void initHeisenberg() {
    config = new HeisenbergExtension();
    config.getPersonalInfo().setName(HEISENBERG);
    config.setEnemies(Arrays.asList("Hank"));
    operations = new HeisenbergOperations();
}
Also used : HeisenbergExtension(org.mule.test.heisenberg.extension.HeisenbergExtension) HeisenbergOperations(org.mule.test.heisenberg.extension.HeisenbergOperations)

Example 28 with HeisenbergExtension

use of org.mule.test.heisenberg.extension.HeisenbergExtension in project mule by mulesoft.

the class GroupValueSetterTestCase method set.

@Test
public void set() throws Exception {
    HeisenbergExtension extension = new HeisenbergExtension();
    valueSetter.set(extension, result);
    assertThat(extension.getPersonalInfo().getName(), is(NAME));
    assertThat(extension.getPersonalInfo().getAge(), is(AGE));
    assertThat(extension.getPersonalInfo().getDateOfBirth(), is(sameInstance(DATE)));
}
Also used : HeisenbergExtension(org.mule.test.heisenberg.extension.HeisenbergExtension) Test(org.junit.Test) SmallTest(org.mule.tck.size.SmallTest)

Aggregations

HeisenbergExtension (org.mule.test.heisenberg.extension.HeisenbergExtension)28 Test (org.junit.Test)24 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)10 BaseEventContext (org.mule.runtime.core.privileged.event.BaseEventContext)6 SmallTest (org.mule.tck.size.SmallTest)6 List (java.util.List)3 ResolverSetResult (org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSetResult)3 ArrayList (java.util.ArrayList)2 ResolverSet (org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet)2 ImmutableList (com.google.common.collect.ImmutableList)1 Arrays.asList (java.util.Arrays.asList)1 HashMap (java.util.HashMap)1 Optional.empty (java.util.Optional.empty)1 Optional.of (java.util.Optional.of)1 MINUTES (java.util.concurrent.TimeUnit.MINUTES)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1 CoreMatchers.not (org.hamcrest.CoreMatchers.not)1 CoreMatchers.sameInstance (org.hamcrest.CoreMatchers.sameInstance)1 Matchers.containsInAnyOrder (org.hamcrest.Matchers.containsInAnyOrder)1 After (org.junit.After)1