Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 1022943] Don't duplicate the test setup that can be shared.
Browse files Browse the repository at this point in the history
  • Loading branch information
metlos committed Apr 30, 2014
1 parent a5aff45 commit af569be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ public abstract class AbstractBase {
int _platformId ;
int _platformTypeId;

@Before
public void setUp() throws Exception {

protected static void setupRestAssured() {
RestAssured.baseURI = "http://" + System.getProperty("rest.server","localhost") ;
RestAssured.port = 7080;
RestAssured.basePath = "/rest/";
RestAssured.authentication = basic("rhqadmin","rhqadmin");
}

@Before
public void setUp() throws Exception {
setupRestAssured();

Resource resource = new Resource();
resource.setResourceName(REST_TEST_DUMMY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,14 @@

package org.rhq.modules.integrationTests.restApi;

import static com.jayway.restassured.RestAssured.basic;
import static com.jayway.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.isOneOf;
import static org.hamcrest.Matchers.startsWith;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

import com.jayway.restassured.RestAssured;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.path.json.JsonPath;

Expand All @@ -50,10 +45,7 @@ public class PluginsTest extends AbstractBase {

@BeforeClass
public static void installDummyPlugin() throws Exception {
RestAssured.baseURI = "http://" + System.getProperty("rest.server","localhost") ;
RestAssured.port = 7080;
RestAssured.basePath = "/rest/";
RestAssured.authentication = basic("rhqadmin","rhqadmin");
setupRestAssured();

InputStream in =
PluginsTest.class.getClassLoader().getResourceAsStream("dummy-rhq-plugin.xml");
Expand Down

0 comments on commit af569be

Please sign in to comment.