@Test
    public void testDetectCouriers() throws Exception {

        //get trackings of this number.
        List<Courier> couriers = connection.detectCouriers(trackingNumberToDetect);
        assertEquals("It should return 2 couriers", 2, couriers.size());
        //the couriers should be dpd or fedex
        assertTrue("It should  have slug equals",couriers.get(0).getSlug().equals(couriersDetected[0])
                || couriers.get(1).getSlug().equals(couriersDetected[0]));
        assertTrue("It should  have slug equals",couriers.get(0).getSlug().equals(couriersDetected[1])
                || couriers.get(1).getSlug().equals(couriersDetected[1]));

        //if the trackingNumber doesn't match any courier defined, should give an error.

        try {
            List<Courier> couriers1 = connection.detectCouriers(trackingNumberToDetectError);
            assertEquals("It should return 0 couriers", 0, couriers1.size());
        }catch (AftershipAPIException e){
        Assert.assertEquals("{\"meta\":{\"code\":4005,\"message\":\"The value of `tracking_number` is invalid.\",\"type\":\"BadRequest\"},\"data\":{\"tracking\":{\"tracking_number\":\"asdq\"}}}", e.getMessage());
    }

        List<String> slugs = new ArrayList<String>();
        slugs.add("dtdc");
        slugs.add("ukrposhta");
        slugs.add("usps");
     //   slugs.add("asdfasdfasdfasd");
        slugs.add("dpd");
        List<Courier> couriers2 = connection.detectCouriers(trackingNumberToDetect,"28046","",null,slugs);
        assertEquals("It should return 1 couriers", 1, couriers2.size());
    }