Search in sources :

Example 1 with Revolver

use of org.mule.test.subtypes.extension.Revolver in project mule by mulesoft.

the class SubTypesMappingParserTestCase method subtypeContributionToOtherExtension.

@Test
public void subtypeContributionToOtherExtension() throws Exception {
    HeisenbergExtension heisenberg = lookupHeisenberg("heisenberg");
    assertThat(heisenberg, is(notNullValue()));
    List<? extends Weapon> wildCardWeapons = heisenberg.getWildCardWeapons();
    assertThat(wildCardWeapons, is(notNullValue()));
    assertThat(wildCardWeapons, hasSize(2));
    assertThat(wildCardWeapons.get(0), instanceOf(Ricin.class));
    assertThat(((Ricin) wildCardWeapons.get(0)).getMicrogramsPerKilo(), is(10L));
    assertThat(((Ricin) wildCardWeapons.get(0)).getDestination(), is(notNullValue()));
    assertThat(((Ricin) wildCardWeapons.get(0)).getDestination().getVictim(), is("Krazy-8"));
    assertThat(wildCardWeapons.get(1), instanceOf(Revolver.class));
    assertThat(((Revolver) wildCardWeapons.get(1)).getBullets(), is(3));
}
Also used : Revolver(org.mule.test.subtypes.extension.Revolver) Ricin(org.mule.test.heisenberg.extension.model.Ricin) HeisenbergExtension(org.mule.test.heisenberg.extension.HeisenbergExtension) Test(org.junit.Test)

Example 2 with Revolver

use of org.mule.test.subtypes.extension.Revolver in project mule by mulesoft.

the class SubTypesMappingParserTestCase method parseRevolver.

@Test
public void parseRevolver() throws Exception {
    Revolver revolver = registry.<Revolver>lookupByName("sledgeHammer's").get();
    assertThat(revolver, is(notNullValue()));
    assertThat(revolver.getBullets(), is(1));
}
Also used : Revolver(org.mule.test.subtypes.extension.Revolver) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 Revolver (org.mule.test.subtypes.extension.Revolver)2 HeisenbergExtension (org.mule.test.heisenberg.extension.HeisenbergExtension)1 Ricin (org.mule.test.heisenberg.extension.model.Ricin)1