package com.perforce.hws.plugin.perforce;
import com.perforce.hws.core.test.SampleServerRule;
import com.perforce.hws.core.test.SimpleResponse;
import com.perforce.hws.core.test.SimpleTestSpark;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.net.URL;
/**
* Created by pallen on 16/08/2016.
*/
public class JobFunctionalTest extends DefaultFunctionalTests {
@Rule
public SampleServerRule p4d = new SampleServerRule(P4BIN, ROOT, VERSION);
@Before
public void before() throws Exception {
init(p4d.getRshPort());
}
@Test
public void testJobs() throws Exception {
String ticket = login("admin", "Password");
// Test GET /jobs
URL jobsUrl = new URL(HOST + PORT + "/api/p4/v" + VERSION + "/" + ID + "/jobs");
SimpleResponse response = SimpleTestSpark.get(jobsUrl, ticket);
Assert.assertEquals("Code", 200, response.status);
}
}