Search in sources :

Example 1 with PetStoreClient

use of org.mule.test.petstore.extension.PetStoreClient in project mule by mulesoft.

the class PetStoreConnectionTestCase method getClient.

protected PetStoreClient getClient() throws Exception {
    PetStoreClient client = (PetStoreClient) runFlow("getClient").getMessage().getPayload().getValue();
    assertThat(client, is(notNullValue()));
    return client;
}
Also used : PetStoreClient(org.mule.test.petstore.extension.PetStoreClient)

Example 2 with PetStoreClient

use of org.mule.test.petstore.extension.PetStoreClient in project mule by mulesoft.

the class PetStoreConnectionTestCase method verifyClient.

@Test
public void verifyClient() throws Exception {
    PetStoreClient client = getClient();
    assertValidClient(client);
}
Also used : PetStoreClient(org.mule.test.petstore.extension.PetStoreClient) Test(org.junit.Test)

Example 3 with PetStoreClient

use of org.mule.test.petstore.extension.PetStoreClient in project mule by mulesoft.

the class PetStoreISO8601DateParsingTestCase method testDateTimeList.

@Test
public void testDateTimeList() throws Exception {
    PetStoreClient client = getClient("getDateTimeList");
    List<LocalDateTime> dates = client.getDiscountDates();
    assertEquals(dates.size(), 1);
    assertDateTime(dates.get(0));
}
Also used : LocalDateTime(java.time.LocalDateTime) PetStoreClient(org.mule.test.petstore.extension.PetStoreClient) Test(org.junit.Test)

Example 4 with PetStoreClient

use of org.mule.test.petstore.extension.PetStoreClient in project mule by mulesoft.

the class PetStoreISO8601DateParsingTestCase method testDateList.

@Test
public void testDateList() throws Exception {
    Calendar calendar = Calendar.getInstance();
    PetStoreClient client = getClient("getDateList");
    List<Date> dates = client.getClosedForHolidays();
    calendar.setTime(dates.get(0));
    assertEquals(dates.size(), 1);
    assertDate(calendar);
}
Also used : PetStoreClient(org.mule.test.petstore.extension.PetStoreClient) Calendar(java.util.Calendar) Date(java.util.Date) Test(org.junit.Test)

Example 5 with PetStoreClient

use of org.mule.test.petstore.extension.PetStoreClient in project mule by mulesoft.

the class PetStoreConnectionTestCase method stopAndDisconnect.

@Test
public void stopAndDisconnect() throws Exception {
    PetStoreClient client = getClient();
    muleContext.stop();
    assertThat(client.getDisconnectCount(), is(1));
    assertThat(client.hasActiveConnection(), is(false));
}
Also used : PetStoreClient(org.mule.test.petstore.extension.PetStoreClient) Test(org.junit.Test)

Aggregations

PetStoreClient (org.mule.test.petstore.extension.PetStoreClient)8 Test (org.junit.Test)7 Calendar (java.util.Calendar)2 LocalDateTime (java.time.LocalDateTime)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Future (java.util.concurrent.Future)1 ConnectionException (org.mule.runtime.api.connection.ConnectionException)1 JUnitProbe (org.mule.tck.probe.JUnitProbe)1 PollingProber (org.mule.tck.probe.PollingProber)1