當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpTest類代碼示例

本文整理匯總了Java中com.eclipsesource.restfuse.annotation.HttpTest的典型用法代碼示例。如果您正苦於以下問題:Java HttpTest類的具體用法?Java HttpTest怎麽用?Java HttpTest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HttpTest類屬於com.eclipsesource.restfuse.annotation包,在下文中一共展示了HttpTest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: newGame

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games
 * Method: POST
 */
@HttpTest(  method = Method.POST,
        path = "",
        content = "{\n" +
                "    \"name\": \"Just for test\",\n" +
                "    \"description\": \"Testing game\",\n" +
                "    \"type\": \"offline\",\n" +
                "    \"board\": \"10x10\",\n" +
                "    \"state\": \"open\"\n" +
                "}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void newGame(){
    assertCreated( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:20,代碼來源:GameControllerTest.java

示例2: newUser

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * /users
 * Method: POST
 */
@HttpTest(  method = Method.POST,
        path = "",
        content = "{\n" +
                "    \"uuid\"\t\t: null,\n" +
                "    \"login\"\t\t: \"testLogin\",\n" +
                "    \"firstName\"\t: \"testFirstName\",\n" +
                "    \"lastName\"\t: \"testLastName\",\n" +
                "    \"email\"\t\t: \"[email protected]\",\n" +
                "    \"password\"\t: \"password\",\n" +
                "    \"enabled\"\t: true,\n" +
                "    \"created\"\t: 1369311377195,\n" +
                "    \"modified\"\t: 1369311377195,\n" +
                "    \"lastLogin\"\t: 1369311377195\n" +
                "}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void newUser(){
    assertCreated( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:25,代碼來源:UserControllerTest.java

示例3: modUser

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * /users/{uuid}
 * Method: PUT
 */
@HttpTest(  method = Method.PUT,
        path = "/2",
        content = "{\n" +
                "    \"uuid\"\t\t: null,\n" +
                "    \"login\"\t\t: \"modified\",\n" +
                "    \"firstName\"\t: \"testFirstName\",\n" +
                "    \"lastName\"\t: \"testLastName\",\n" +
                "    \"email\"\t\t: \"[email protected]\",\n" +
                "    \"password\"\t: \"password\",\n" +
                "    \"enabled\"\t: true\n" +
                "}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void modUser(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:22,代碼來源:UserControllerTest.java

示例4: testInvalidLogin

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
@HttpTest(method = Method.POST, path = "/user/barney/authenticate", type = MediaType.APPLICATION_JSON, 
		content = "{\"userName\":\"barney\",\"password\":\"barney\"}")
public void testInvalidLogin() {
	assertBadRequest(response);
	String messg = response.getBody();
	Assert.assertEquals("Invalid username: barney", messg);
}
 
開發者ID:dnng,項目名稱:SSNoC-Java,代碼行數:8,代碼來源:UserServiceIT.java

示例5: testuserGroupsListsUsers

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
@HttpTest(method = Method.GET, path = "/1")
public void testuserGroupsListsUsers() {
	String message = response.getBody();
	//assertTrue(message, message.contains("[{\"userNames\""));
	//[{"userNames":["bbbb","aaaa","SSNAdmin"]}]
	//assertTrue(message, message.matches("\\[\\{\"userNames\":\\[(\"\\w+\",?)*\\]\\}\\]"));
	//Sample output is: [{"userNames":["SSNAdmin"]},{"userNames":["testuser"]}]
	assertTrue(message.contains("SSNAdmin"));
	
}
 
開發者ID:dnng,項目名稱:SSNoC-Java,代碼行數:11,代碼來源:UserGroupsServiceIT.java

示例6: checkApiInfoResponse

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
@HttpTest(method = Method.GET, path = "/get-api-info")
public void checkApiInfoResponse() {
    assertOk(response);

    Gson gson = new Gson();
    ApiInfo apiInfo = gson.fromJson(response.getBody(), ApiInfo.class);

    Assert.assertEquals(apiInfo, new ApiInfo());
}
 
開發者ID:hostirosti,項目名稱:java-rest-example-appengine,代碼行數:10,代碼來源:JavaRESTExampleIntegrationTest.java

示例7: checkHelloWorldResponse

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
@HttpTest(method = Method.GET, path = "/api/v1/hello-world")
public void checkHelloWorldResponse() {
    assertOk(response);

    Gson gson = new Gson();
    HelloWorld helloWord = gson.fromJson(response.getBody(), HelloWorld.class);

    Assert.assertEquals(helloWord, new HelloWorld());
}
 
開發者ID:hostirosti,項目名稱:java-rest-example-appengine,代碼行數:10,代碼來源:JavaRESTExampleIntegrationTest.java

示例8: getGames

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games
 * Method: GET
 */
@HttpTest(  method = Method.GET,
        path = "",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void getGames(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:13,代碼來源:GameControllerTest.java

示例9: getGamesFiltered

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games?field={field}&value={value}
 * Method: GET
 */
@HttpTest(  method = Method.GET,
        path = "?field=state&value=open",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void getGamesFiltered(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:13,代碼來源:GameControllerTest.java

示例10: getGame

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games/{gauid}
 * Method: GET
 */
@HttpTest(  method = Method.GET,
        path = "/1",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void getGame(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:13,代碼來源:GameControllerTest.java

示例11: modGame

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games/{gauid}
 * Method: PUT
 */
@HttpTest(  method = Method.PUT,
        path = "/1",
        content = "{\n" +
                "    \"name\": \"Changed name\",\n" +
                "    \"description\": \"Testing game\"" +
                "}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void modGame(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:17,代碼來源:GameControllerTest.java

示例12: joinGame

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games/{gauid}?action=join
 * Method: PUT
 */
@HttpTest(  method = Method.PUT,
        path = "/1?action=join",
        content = "{}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "user", password = "user" ) }
)
public void joinGame(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:14,代碼來源:GameControllerTest.java

示例13: closeGame

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games/{gauid}?action=close
 * Method: PUT
 */
@HttpTest(  method = Method.PUT,
        path = "/1?action=close",
        content = "{}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void closeGame(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:14,代碼來源:GameControllerTest.java

示例14: getGameSteps

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games/{gauid}/steps
 * Method: GET
 */
@HttpTest(  method = Method.GET,
        path = "/1/steps",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void getGameSteps(){
    assertOk( response );
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:13,代碼來源:GameControllerTest.java

示例15: newStepInGame

import com.eclipsesource.restfuse.annotation.HttpTest; //導入依賴的package包/類
/**
 * Test for /games/{gauid}/steps
 * Method: POST
 */
@HttpTest(  method = Method.POST,
        path = "/1/steps",
        content = "{\n" +
                "  \"step\"  : \"a1-b3\"\n" +
                "}",
        authentications = {
                @Authentication( type = AuthenticationType.BASIC, user = "admin", password = "admin" ) }
)
public void newStepInGame(){
    assertBadRequest(response);
}
 
開發者ID:pavelkuchin,項目名稱:checkers,代碼行數:16,代碼來源:GameControllerTest.java


注:本文中的com.eclipsesource.restfuse.annotation.HttpTest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。