Search in sources :

Example 11 with Release

use of org.candlepin.model.Release in project candlepin by candlepin.

the class ActivationKeyResourceTest method testUpdateTooLongRelease.

@Test(expected = BadRequestException.class)
public void testUpdateTooLongRelease() {
    ActivationKey key = new ActivationKey();
    OwnerDTO ownerDto = new OwnerDTO();
    key.setOwner(owner);
    key.setName("dd");
    key.setServiceLevel("level1");
    key.setReleaseVer(new Release("release1"));
    activationKeyCurator.create(key);
    ActivationKeyDTO update = new ActivationKeyDTO();
    update.setOwner(ownerDto);
    update.setName("dd");
    update.setServiceLevel("level1");
    update.setReleaseVersion(TestUtil.getStringOfSize(256));
    activationKeyResource.updateActivationKey(key.getId(), update);
}
Also used : ActivationKeyDTO(org.candlepin.dto.api.v1.ActivationKeyDTO) OwnerDTO(org.candlepin.dto.api.v1.OwnerDTO) ActivationKey(org.candlepin.model.activationkeys.ActivationKey) Release(org.candlepin.model.Release) Test(org.junit.Test)

Aggregations

Release (org.candlepin.model.Release)11 Environment (org.candlepin.model.Environment)4 Owner (org.candlepin.model.Owner)4 Product (org.candlepin.model.Product)4 ActivationKey (org.candlepin.model.activationkeys.ActivationKey)4 ActivationKeyContentOverride (org.candlepin.model.activationkeys.ActivationKeyContentOverride)4 ActivationKeyDTO (org.candlepin.dto.api.v1.ActivationKeyDTO)3 ConsumerCapability (org.candlepin.model.ConsumerCapability)3 ConsumerInstalledProduct (org.candlepin.model.ConsumerInstalledProduct)3 ConsumerType (org.candlepin.model.ConsumerType)3 ActivationKeyPool (org.candlepin.model.activationkeys.ActivationKeyPool)3 Date (java.util.Date)2 HashSet (java.util.HashSet)2 NotFoundException (org.candlepin.common.exceptions.NotFoundException)2 GuestId (org.candlepin.model.GuestId)2 Pool (org.candlepin.model.Pool)2 Test (org.junit.Test)2 Transactional (com.google.inject.persist.Transactional)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1