コード例 #1
0
 @Test
 public void testReadRecordAbstractRecordType() {
   String type = "abstract";
   response =
       recordEndpoint.readRecord(AUTH_TOKEN, AUTH_TOKEN, type, "canBeWhatEverIdTypeIsChecked");
   assertResponseStatusIs(Response.Status.METHOD_NOT_ALLOWED);
 }
コード例 #2
0
  private void expectTokenForReadToPrefereblyBeHeaderThanQuery(
      String headerAuthToken, String queryAuthToken, String authTokenExpected) {
    SpiderInstanceFactorySpy factorySpy = setupInstanceProviderWithFactorySpy();

    response = recordEndpoint.readRecord(headerAuthToken, queryAuthToken, PLACE, PLACE_0001);

    SpiderRecordReaderSpy spiderReaderSpy = factorySpy.spiderRecordReaderSpy;
    assertEquals(spiderReaderSpy.authToken, authTokenExpected);
  }
コード例 #3
0
 @Test
 public void testReadRecordNotFound() {
   response = recordEndpoint.readRecord(AUTH_TOKEN, AUTH_TOKEN, PLACE, "place:0001_NOT_FOUND");
   assertResponseStatusIs(Response.Status.NOT_FOUND);
 }
コード例 #4
0
 @Test
 public void testReadRecord() {
   response = recordEndpoint.readRecord(AUTH_TOKEN, AUTH_TOKEN, PLACE, PLACE_0001);
   assertEntityExists();
   assertResponseStatusIs(Response.Status.OK);
 }