String componentKey = "org.codehaus.sonar:sonar";
MockUserSession.set().setLogin("john").addComponentPermission(UserRole.USER, componentKey, componentKey);
when(componentDao.getNullableByKey(session, componentKey)).thenReturn(project);
when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
when(propertiesDao.selectByQuery(any(PropertyQuery.class), eq(session))).thenReturn(newArrayList(new PropertyDto()));
WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("key", componentKey);
request.execute().assertJson(getClass(), "app_without_sub_project.json");
}