static CpuProfile getModel(int index) { CpuProfile model = new CpuProfile(); model.setId(GUIDS[index].toString()); model.setName(NAMES[index]); model.setDescription(DESCRIPTIONS[index]); return model; }
@Test public void testConflictedUpdate() throws Exception { setUriInfo(setUpBasicUriExpectations()); setUpEntityQueryExpectations(1, 0, false); control.replay(); CpuProfile model = getModel(1); model.setId(GUIDS[1].toString()); try { resource.update(model); fail("expected WebApplicationException"); } catch (WebApplicationException wae) { verifyImmutabilityConstraint(wae); } }