예제 #1
0
  @Test(expected = NotFoundException.class)
  public void unbindByInvalidSerialShouldFail() {
    Consumer consumer = createConsumer();
    ConsumerCurator consumerCurator = mock(ConsumerCurator.class);
    when(consumerCurator.verifyAndLookupConsumer(eq("fake uuid"))).thenReturn(consumer);

    EntitlementCurator entitlementCurator = mock(EntitlementCurator.class);
    when(entitlementCurator.find(any(Serializable.class))).thenReturn(null);

    ConsumerResource consumerResource =
        new ConsumerResource(
            consumerCurator,
            null,
            null,
            null,
            entitlementCurator,
            null,
            null,
            i18n,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            new CandlepinCommonTestConfig(),
            null,
            null,
            null,
            consumerBindUtil,
            productCurator,
            null);

    consumerResource.unbindBySerial("fake uuid", Long.valueOf(1234L));
  }