Java UNAUTHORIZED Example

说明

java unauthorized示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Java

命名空间/包名称: javax.ws.rs.core.Response.Status

示例#1
文件: SignPathTest.java项目: roioteromorales/godutch

 @Test
 public void signOut_shouldReturnFalse_ifSignsOutWithoutBeingSignedIn() throws Exception {
   HttpRequest signOutRequest = signOutRequest("TOKEN");
   assertThat(signOutRequest.code()).isEqualTo(UNAUTHORIZED.getStatusCode());
   assertThat(signOutRequest.body()).isEqualTo("false");
 }

示例#2
文件: SignPathTest.java项目: roioteromorales/godutch

  @Test
  public void signIn_shouldReturnUnauthorizedStatusCode_ifNotLoggedIn() throws Exception {
    HttpRequest signInRequest = signInRequest("notLoggedInEmail", "pass");

    assertThat(signInRequest.code()).isEqualTo(UNAUTHORIZED.getStatusCode());
  }

展开阅读全文