@Test
	public void testSavePerfTestExist() {
		String testName = "test1";
		String newName = "new test1";
		PerfTest test = createPerfTest(testName, Status.READY, now());
		test.setTestName(newName);

		PerfTest newTest = new PerfTest();
		newTest.setId(test.getId());
		newTest.setTestName(newName);
		newTest.setStatus(Status.SAVED);
		newTest.setThreshold(test.getThreshold());
		newTest.setDuration(test.getDuration());
		newTest.setVuserPerAgent(test.getVuserPerAgent());
		newTest.setScheduledTime(test.getScheduledTime());
		newTest.setIgnoreSampleCount(test.getIgnoreSampleCount());
		newTest.setTargetHosts(test.getTargetHosts());
		newTest.setScriptName(test.getScriptName());
		newTest.setProcesses(2);
		newTest.setThreads(2);
		newTest.setVuserPerAgent(newTest.getProcesses() * newTest.getThreads());
		newTest.setRegion(config.getRegion());
		newTest.setAgentCount(1);
		newTest.setScm("svn");

		perfTestApiController.saveOne(getTestUser(), newTest, false);
		PerfTest savedTest = perfTestApiController.getOne(getTestUser(), newTest.getId());
		assertEquals(savedTest.getTestName(), newName);
		assertEquals(savedTest.getId(), test.getId());

		newTest.setStatus(Status.READY);
		perfTestApiController.saveOne(getTestUser(), newTest, false);
		savedTest = perfTestApiController.getOne(getTestUser(), newTest.getId());
		assertEquals(savedTest.getTestName(), newName);
		assertEquals(savedTest.getId(), test.getId());

		// test status id "START_TESTING", can not be saved.
		newTest.setStatus(Status.START_TESTING);
		try {
			newTest.setStatus(Status.START_TESTING);
			perfTestApiController.saveOne(getTestUser(), newTest, false);
			fail("test status id START_TESTING, can not be saved");
		} catch (IllegalArgumentException e) {
			noOp();
		}
	}
for "saved" or "ready" test, can be modified, but for running or finished test, can not
modify
ngrinder-controller/src/test/java/org/ngrinder/perftest/controller/PerfTestControllerTest.java