more integration tests
This commit is contained in:
parent
c21f0ef463
commit
e4cf8e149c
1 changed files with 15 additions and 1 deletions
|
@ -51,7 +51,7 @@ public class WebserviceInfoTest extends AdministrationAPIIntegrationTester {
|
|||
@Test
|
||||
public void test_getInstitutionInfo() throws Exception {
|
||||
|
||||
final Collection<EntityName> result = new RestAPITestHelper()
|
||||
Collection<EntityName> result = new RestAPITestHelper()
|
||||
.withAccessToken(getAdminInstitution1Access())
|
||||
.withPath(API.INFO_ENDPOINT + API.INFO_INST_PATH_SEGMENT)
|
||||
.withMethod(HttpMethod.GET)
|
||||
|
@ -64,6 +64,20 @@ public class WebserviceInfoTest extends AdministrationAPIIntegrationTester {
|
|||
assertTrue(result.stream().filter(en -> "Institution2".equals(en.name)).findFirst().isPresent());
|
||||
assertFalse(result.stream().filter(en -> "Institution3".equals(en.name)).findFirst().isPresent());
|
||||
|
||||
result = new RestAPITestHelper()
|
||||
.withAccessToken(getAdminInstitution1Access())
|
||||
.withPath(API.INFO_ENDPOINT + API.INFO_INST_PATH_SEGMENT)
|
||||
.withPath("/inst2")
|
||||
.withMethod(HttpMethod.GET)
|
||||
.withExpectedStatus(HttpStatus.OK)
|
||||
.getAsObject(new TypeReference<Collection<EntityName>>() {
|
||||
});
|
||||
|
||||
assertNotNull(result);
|
||||
assertFalse(result.stream().filter(en -> "Institution1".equals(en.name)).findFirst().isPresent());
|
||||
assertTrue(result.stream().filter(en -> "Institution2".equals(en.name)).findFirst().isPresent());
|
||||
assertFalse(result.stream().filter(en -> "Institution3".equals(en.name)).findFirst().isPresent());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue