Java Code Examples for io.restassured.RestAssured#basePath()

The following examples show how to use io.restassured.RestAssured#basePath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SearchNonIndexedFields.java    From SearchServices with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Test that non indexed fields are not created in SOLR Schema
 */
@Test(priority = 2)
public void testNonIndexedDoesNotExist()
{
    RestAssured.basePath = "solr/alfresco";
    
    restClient.configureSolrEndPoint();
    restClient.configureRequestSpec().setBasePath(RestAssured.basePath);

    RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "admin/luke");
    RestTextResponse response = restClient.processTextResponse(request);
    String bodyResponse = response.getResponse().getBody().print();
    
    Assert.assertTrue(bodyResponse.contains("{http://www.alfresco.org/model/index/1.0}indexed"), 
            "Expecting index:indexed field to be present in SOLR Schema");
    Assert.assertFalse(bodyResponse.contains("{http://www.alfresco.org/model/index/1.0}nonIndexed"), 
            "Expecting index:nonIndexed field NOT to be present in SOLR Schema");

}
 
Example 2
Source File: ProviderFilterTest.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void startApplication() {
    RestAssured.basePath = "";
    int port = SocketUtils.findAvailableTcpPort();
    RestAssured.port = port;
    SpringApplication springApplication = new SpringApplication(TestApplication.class);
    ctx = springApplication.run("--spring.profiles.active=provider", "--server.port=" + port);
}
 
Example 3
Source File: QueryIntegrationTest.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
@BeforeEach
public void setUp() {
    RestAssured.port = PORT;
    RestAssured.basePath = BASE_PATH;
    RestAssured.useRelaxedHTTPSValidation();

    token = SecurityUtils.gatewayToken(USERNAME, PASSWORD);
}
 
Example 4
Source File: ZosmfSsoIntegrationTest.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
@BeforeEach
public void setUp() {
    GatewayServiceConfiguration serviceConfiguration = ConfigReader.environmentConfiguration().getGatewayServiceConfiguration();
    scheme = serviceConfiguration.getScheme();
    host = serviceConfiguration.getHost();
    port = serviceConfiguration.getPort();

    RestAssured.port = port;
    RestAssured.basePath = BASE_PATH;
    RestAssured.useRelaxedHTTPSValidation();
    token = SecurityUtils.gatewayToken(USERNAME, PASSWORD);
}
 
Example 5
Source File: JwtPenTest.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
public static String getValidToken() {
    if (validToken == null) {
        RestAssured.port = PORT;
        RestAssured.basePath = "/";
        RestAssured.useRelaxedHTTPSValidation();
        RestAssured.config = RestAssured.config().sslConfig(getConfiguredSslConfig());
        validToken = SecurityUtils.gatewayToken(USERNAME, PASSWORD);
    }

    return validToken;
}
 
Example 6
Source File: AbstractBackupE2ETest.java    From SearchServices with GNU Lesser General Public License v3.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
protected void setupSolrRequest() throws Exception {
	serverHealth.assertServerIsOnline();

	RestAssured.basePath = "solr";
	RestAssured.port = solrPort;
	restWrapper.configureRequestSpec().setPort(solrPort);
	restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
}
 
Example 7
Source File: RestResourceTestBase.java    From rest-example with Apache License 2.0 5 votes vote down vote up
/**
 * Sets up RestAssured test framework before tests.
 */
@BeforeTest
public void setUpRestAssured() {
    RestAssured.reset();
    RestAssured.port = ENDPOINT_PORT;
    RestAssured.basePath = "";
}
 
Example 8
Source File: AbstractTest.java    From spring-cloud-ribbon-extensions with Apache License 2.0 4 votes vote down vote up
@Before
public final void abstractBefore() {
    RestAssured.baseURI = "http://localhost";
    RestAssured.basePath = basePath;
    RestAssured.port = getApplicationPort(applicationName);
}
 
Example 9
Source File: ValidationExceptionHandlerAcceptanceTest.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setUp() {
    RestAssured.port = port;
    RestAssured.basePath = servletContext.getContextPath();
}
 
Example 10
Source File: MicroProfileOpenAPITCKObserver.java    From tomee with Apache License 2.0 4 votes vote down vote up
public void AfterDeploy(@Observes final AfterDeploy afterDeploy) {
    RestAssured.basePath = "microprofile-openapi";
}