@Test public void testReadRecordAbstractRecordType() { String type = "abstract"; response = recordEndpoint.readRecord(AUTH_TOKEN, AUTH_TOKEN, type, "canBeWhatEverIdTypeIsChecked"); assertResponseStatusIs(Response.Status.METHOD_NOT_ALLOWED); }
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); }
@Test public void testReadRecordNotFound() { response = recordEndpoint.readRecord(AUTH_TOKEN, AUTH_TOKEN, PLACE, "place:0001_NOT_FOUND"); assertResponseStatusIs(Response.Status.NOT_FOUND); }
@Test public void testReadRecord() { response = recordEndpoint.readRecord(AUTH_TOKEN, AUTH_TOKEN, PLACE, PLACE_0001); assertEntityExists(); assertResponseStatusIs(Response.Status.OK); }