add live profile
This commit is contained in:
parent
a063b93de0
commit
0d22ab4a44
|
@ -257,7 +257,7 @@
|
|||
<version>${maven-surefire-plugin.version}</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<!-- <exclude>**/*ProductionTest.java</exclude> -->
|
||||
<exclude>**/*LiveTest.java</exclude>
|
||||
</excludes>
|
||||
<systemPropertyVariables>
|
||||
<!-- <provPersistenceTarget>h2</provPersistenceTarget> -->
|
||||
|
@ -289,6 +289,62 @@
|
|||
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>live</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven2-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>start-server</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>stop-server</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>stop</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>none</exclude>
|
||||
</excludes>
|
||||
<includes>
|
||||
<include>**/*LiveTest.java</include>
|
||||
</includes>
|
||||
<systemPropertyVariables>
|
||||
<webTarget>cargo</webTarget>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
||||
<properties>
|
||||
<!-- Spring -->
|
||||
<org.springframework.version>4.2.5.RELEASE</org.springframework.version>
|
||||
|
|
|
@ -17,14 +17,16 @@ import com.jayway.restassured.specification.RequestSpecification;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = { TestConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||
public class FooLiveTest {
|
||||
private static final String URL_PREFIX = "http://localhost:8080/spring-security-rest";
|
||||
private static final String URL_PREFIX = "http://localhost:8082/spring-security-rest";
|
||||
// private FormAuthConfig formConfig = new FormAuthConfig(URL_PREFIX + "/login", "temporary", "temporary");
|
||||
|
||||
private String cookie;
|
||||
|
||||
private RequestSpecification givenAuth() {
|
||||
// return RestAssured.given().auth().form("user", "userPass", formConfig);
|
||||
if (cookie == null)
|
||||
if (cookie == null) {
|
||||
cookie = RestAssured.given().contentType("application/x-www-form-urlencoded").formParam("password", "userPass").formParam("username", "user").post(URL_PREFIX + "/login").getCookie("JSESSIONID");
|
||||
}
|
||||
return RestAssured.given().cookie("JSESSIONID", cookie);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.jayway.restassured.RestAssured;
|
|||
import com.jayway.restassured.response.Response;
|
||||
|
||||
public class SwaggerLiveTest {
|
||||
private static final String URL_PREFIX = "http://localhost:8080/spring-security-rest/api";
|
||||
private static final String URL_PREFIX = "http://localhost:8082/spring-security-rest/api";
|
||||
|
||||
@Test
|
||||
public void whenVerifySpringFoxIsWorking_thenOK() {
|
||||
|
|
Loading…
Reference in New Issue