There is only one instance of Keycloak server running during a single test run.
It is automatically started by Arquillian on the `BeforeSuite` event and stopped `AfterSuite`.
The type of container can be determined by property `-Dauth.server.container`. Default value is `auth-server-undertow`,
other options are: `auth-server-wildfly` and `auth-server-eap7`. The values correspond to Arquillian *container qualifiers* in `arquillian.xml` config file.
**Note 1:** For the non-default options it's necessary to build a corresponding server module prior to running any of the test modules.
This can be done by building the server module directly (from `servers/wildfly`/`servers/eap7`),
or by activating `auth-server-wildfly`/`auth-server-eap7` profile when building from the top level module.
**Note 2:** Most server-side configurations are done during the build of the server module
and included in the output artifact - which is then consumed by the test modules( if a corresponding profile is activated).
To reflect a change in server config in the test (e.g. a datasource) it's necessary to rebuild the server module after each change.
Page Objects are used by tests to access and operate on UI.
They can be injected using annotation `@Page` provided by the *Arquillian Graphene* extension.
The base class for all page objects used throughout this Arquillian testsuite is `AbstractPage`, and it's subclass `AbstractPageWithInjectedUrl`.
For the page objects for the *adapter test apps* the URLs are injected automatically by Arquillian depending on actual URL of the deployed app/example.
For the pages under the `/auth` context the URL is only injected to the `AuthServerContextRoot` page object,
and the URL hierarchy is modeled by the class inheritance hierarchy (subclasses/extending of `AuthServerContextRoot`).
| **Relative** | auth server == app server | client `baseUrl`, `adminUrl` and `redirect-uris` can be relative | `auth-server-url` can be relative |
| **Non-relative** | auth server != app server | client `baseUrl`, `adminUrl` and `redirect-uris` need to include FQDN of the app server | `auth-server-url` needs to include FQDN of the auth server|
#### Adapter Libs Mode
1.**Provided** - By container, e.g. as a subsystem. **Default.**
2.**Bundled** - In the deployed war in `/WEB-INF/libs`. Enable with `-Dadapter.libs.bundled`. *Wildfly only*.
#### Adapter Config Mode
1.~~**Provided** - In `standalone.xml` using `secure-deployment`. *Wildfly only.*~~ WIP
2.**Bundled** - In the deployed war in `/WEB-INF/keycloak.json`. **Default.**
## Maven Modules Structure
```
integration-arquillian
│
├──servers
│ ├──wildfly (activated by -Pauth-server-wildfly)
│ └──eap7 (activated by -Pauth-server-eap7)
│
└──tests (common settings for all test modules)
├──base (custom ARQ extensions + base functional tests)
└──other (common settings for all modules dependent on base)
│
├──adapters (common settings for all adapter submodules)
│ ├──wildfly (activated by -Papp-server-wildfly)
│ ├──wildfly-relative (activated by -Papp-server-wildfly-relative,auth-server-wildfly)
│ ├──...
│ ├──tomcat (activated by -Papp-server-tomcat)
│ └──karaf (activated by -Papp-server-karaf)
│
├──console (activated by -Pconsole-ui-tests)
├──mod_auth_mellon (activated by -Pmod_auth_mellon)