@Test
  public void getDeliveryCandidates()
      throws NoSuchObjectException, UnauthorizedException, NamingException, PathExistsException,
          InvalidNameException {

    // Add some deliveries

    assertEquals(0, delivery.getDeliveryCandidates().size());

    long candidateId = deliveryCandidateBean.create(deliveryId);

    assertEquals(1, delivery.getDeliveryCandidates().size());
    assertEquals(candidateId, delivery.getDeliveryCandidates().get(0).deliveryCandidateId);

    long candidate2Id = deliveryCandidateBean.create(deliveryId);

    List<StudentDeliveryCandidate> candidates = delivery.getDeliveryCandidates();

    assertEquals(2, candidates.size());

    for (StudentDeliveryCandidate c : candidates) {
      long val = c.deliveryCandidateId;
      assertTrue(val == candidateId || val == candidate2Id);
    }
  }
  @Test
  public void createDeliveryCandidate()
      throws NamingException, NoSuchObjectException, UnauthorizedException {

    assertEquals(0, delivery.getDeliveryCandidates().size());

    StudentDeliveryCandidate candidate = delivery.createDeliveryCandidate();

    assertEquals(1, delivery.getDeliveryCandidates().size());

    List<StudentDeliveryCandidate> candidates = delivery.getDeliveryCandidates();
    assertEquals(candidate.deliveryCandidateId, candidates.get(0).deliveryCandidateId);
  }
 @Test
 public void getStatus() throws NamingException, UnauthorizedException {
   deliveryBean.setStatus(deliveryId, 2);
   assertEquals(2, delivery.getStatus());
 }