package org.bench4q.master.unitTest.service;

import static org.junit.Assert.*;

import org.bench4q.master.domain.service.report.ReportService;
import org.bench4q.master.unitTest.TestBase_MakeUpTestPlan;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:service-test-context.xml" })
public class Test_ReportService extends TestBase_MakeUpTestPlan {
	private ReportService reportService;

	private ReportService getReportService() {
		return reportService;
	}

	@Autowired
	private void setReportService(ReportService reportService) {
		this.reportService = reportService;
	}

	@Test
	public void testIsReportCreatedWhenActuallyNotCreated() {
		submitATestPlanWithOneScript();
		assertFalse(this.getReportService().isReportCreated(
				getTestPlanRunIdUuid()));
	}
}
