Examples of GuestId


Examples of org.candlepin.model.GuestId

        Consumer a = new Consumer();
        Owner owner = new Owner();
        owner.setId("FAKEOWNERID");
        a.setOwner(owner);
        for (String guestId : guestIds) {
            a.addGuestId(new GuestId(guestId));
        }
        return a;
    }
View Full Code Here

Examples of org.candlepin.model.GuestId

    public void requiresHostPoolAttributeFiltering() {

        consumer = this.createConsumer(owner);

        Consumer host = createConsumer(owner);
        host.addGuestId(new GuestId("GUESTUUID", host));
        consumerCurator.update(host);

        Product targetProduct = TestUtil.createProduct();
        this.productCurator.create(targetProduct);
View Full Code Here

Examples of org.candlepin.model.GuestId

        consumerTypeCurator.create(type);
        Consumer c = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(c);

        Consumer host = createConsumer(owner);
        host.addGuestId(new GuestId("GUESTUUID", host));
        consumerCurator.update(host);

        Product targetProduct = TestUtil.createProduct();
        this.productCurator.create(targetProduct);
View Full Code Here

Examples of org.candlepin.model.GuestId

        consumerTypeCurator.create(type);
        Consumer c = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(c);

        Consumer host = createConsumer(owner);
        host.addGuestId(new GuestId("GUESTUUID", host));
        consumerCurator.update(host);

        Product targetProduct = TestUtil.createProduct();
        this.productCurator.create(targetProduct);
View Full Code Here

Examples of org.candlepin.model.GuestId

    }

    @Test
    public void getGuestIds() {
        List<GuestId> guestIds = new LinkedList<GuestId>();
        guestIds.add(new GuestId("1"));
        guestIds.add(new GuestId("2"));
        when(guestIdCurator.listByConsumer(eq(consumer), any(PageRequest.class)))
            .thenReturn(buildPaginatedGuestIdList(guestIds));
        List<GuestId> result = guestIdResource.getGuestIds(consumer.getUuid(), null);
        assertEquals(2, result.size());
        assertTrue(result.contains(new GuestId("1")));
        assertTrue(result.contains(new GuestId("2")));
    }
View Full Code Here

Examples of org.candlepin.model.GuestId

    @Test(expected = NotFoundException.class)
    public void getGuestIdNoGuests() {
        when(guestIdCurator.findByConsumerAndId(eq(consumer), any(String.class)))
            .thenReturn(null);
        GuestId result = guestIdResource.getGuestId(consumer.getUuid(), "some-id");
    }
View Full Code Here

Examples of org.candlepin.model.GuestId

    }

    @Test
    public void getGuestId() {
        when(guestIdCurator.findByConsumerAndId(eq(consumer), any(String.class)))
            .thenReturn(new GuestId("guest"));
        GuestId result = guestIdResource.getGuestId(consumer.getUuid(), "some-id");
        assertEquals(new GuestId("guest"), result);
    }
View Full Code Here

Examples of org.candlepin.model.GuestId

    }

    @Test
    public void updateGuests() {
        List<GuestId> guestIds = new LinkedList<GuestId>();
        guestIds.add(new GuestId("1"));
        when(consumerResource.performConsumerUpdates(any(Consumer.class),
            eq(consumer))).thenReturn(true);

        guestIdResource.updateGuests(consumer.getUuid(), guestIds);
        Mockito.verify(consumerResource, Mockito.times(1))
View Full Code Here

Examples of org.candlepin.model.GuestId

    }

    @Test
    public void updateGuestsNoUpdate() {
        List<GuestId> guestIds = new LinkedList<GuestId>();
        guestIds.add(new GuestId("1"));

        // consumerResource tells us nothing changed
        when(consumerResource.performConsumerUpdates(any(Consumer.class),
            eq(consumer))).thenReturn(false);
View Full Code Here

Examples of org.candlepin.model.GuestId

        Mockito.verify(consumerCurator, Mockito.never()).update(eq(consumer));
    }

    @Test
    public void updateGuest() {
        GuestId guest = new GuestId("some_guest");
        guestIdResource.updateGuest(consumer.getUuid(), guest.getGuestId(), guest);
        assertEquals(consumer, guest.getConsumer());
        Mockito.verify(guestIdCurator, Mockito.times(1)).merge(eq(guest));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.