Search in sources :

Example 1 with PersonalInfo

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

the class SingleValueResolverTestCase method set.

@Test
public void set() throws Exception {
    PersonalInfo info = new PersonalInfo();
    valueSetter.set(info, result);
    assertThat(info.getName(), is(NAME));
}
Also used : PersonalInfo(org.mule.test.heisenberg.extension.model.PersonalInfo) Test(org.junit.Test) SmallTest(org.mule.tck.size.SmallTest)

Example 2 with PersonalInfo

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

the class OperationExecutionTestCase method getInlineGroupPersonalInfoAsArgument.

@Test
public void getInlineGroupPersonalInfoAsArgument() throws Exception {
    Message message = flowRunner("getInlinePersonalInfo").withPayload(EMPTY_STRING).run().getMessage();
    assertThat(message.getPayload().getValue(), is(notNullValue()));
    PersonalInfo value = (PersonalInfo) message.getPayload().getValue();
    assertThat(value.getAge(), is(26));
    assertThat(value.getKnownAddresses().get(0), is("explicitAddress"));
    assertThat(value.getName(), is("Pepe"));
}
Also used : Message(org.mule.runtime.api.message.Message) PersonalInfo(org.mule.test.heisenberg.extension.model.PersonalInfo) Test(org.junit.Test)

Example 3 with PersonalInfo

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

the class DefaultObjectBuilderTestCase method reusable.

@Test
public void reusable() throws Exception {
    populate(false);
    PersonalInfo info1 = builder.build(resolvingContext);
    PersonalInfo info2 = builder.build(resolvingContext);
    PersonalInfo info3 = builder.build(resolvingContext);
    assertThat(info1, is(not(sameInstance(info2))));
    assertThat(info1, is(not(sameInstance(info3))));
    verify(info1);
    verify(info2);
    verify(info3);
}
Also used : PersonalInfo(org.mule.test.heisenberg.extension.model.PersonalInfo) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 4 with PersonalInfo

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

the class DefaultObjectBuilderTestCase method build.

@Test
public void build() throws Exception {
    populate(false);
    PersonalInfo personalInfo = builder.build(resolvingContext);
    verify(personalInfo);
}
Also used : PersonalInfo(org.mule.test.heisenberg.extension.model.PersonalInfo) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 5 with PersonalInfo

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

the class GroupValueSetterTestCase method before.

@Before
public void before() throws Exception {
    final String personalInfo = "personalInfo";
    ParameterGroupDescriptor group = new ParameterGroupDescriptor("group", new TypeWrapper(PersonalInfo.class, new JavaTypeLoader(Thread.currentThread().getContextClassLoader())), ExtensionsTypeLoaderFactory.getDefault().createTypeLoader().load(PersonalInfo.class), getField(HeisenbergExtension.class, personalInfo, reflectionCache).get(), null);
    Map<String, Object> resultMap = new HashMap<>();
    resultMap.put("name", NAME);
    resultMap.put("age", AGE);
    resultMap.put("dateOfBirth", DATE);
    when(result.asMap()).thenReturn(resultMap);
    valueSetter = new GroupValueSetter(group, () -> reflectionCache);
}
Also used : TypeWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper) PersonalInfo(org.mule.test.heisenberg.extension.model.PersonalInfo) HashMap(java.util.HashMap) ParameterGroupDescriptor(org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor) JavaTypeLoader(org.mule.metadata.java.api.JavaTypeLoader) Before(org.junit.Before)

Aggregations

PersonalInfo (org.mule.test.heisenberg.extension.model.PersonalInfo)6 Test (org.junit.Test)5 SmallTest (org.mule.tck.size.SmallTest)3 HashMap (java.util.HashMap)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Before (org.junit.Before)1 JavaTypeLoader (org.mule.metadata.java.api.JavaTypeLoader)1 Message (org.mule.runtime.api.message.Message)1 ExtensionNotification (org.mule.runtime.api.notification.ExtensionNotification)1 Flow (org.mule.runtime.core.api.construct.Flow)1 ParameterGroupDescriptor (org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor)1 TypeWrapper (org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper)1