Skip to content

Test Setting

Eliza Margaretha Illig edited this page Oct 23, 2024 · 4 revisions

BasicAuthentication

BasicAuthentication is an dummy authentication method intended for testing only. It uses HTTP Basic Authentication protocol.

BasicAuthentication allows any combination of username and password, and doesn't do any checking or match of them. Technically it uses a dummy UserDao. If desired, it can be modified to support some credentials checking, for instance by connecting it to a user table in a database.

BasicAuthentication is included in the test suite, see the Spring XML test configuration file.

<bean id="basic_auth"
	class="de.ids_mannheim.korap.authentication.BasicAuthentication" />
	
<util:list id="kustvakt_authproviders"
	value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
	<ref bean="basic_auth" />
	...
</util:list>

BasicAuthentication can also be used for testing a Kustvakt.jar. See Running Kustvakt jar in the Test Environment

Data folder

For testing a Kustvakt jar with the test environment, all custom configuration files should be located at the data folder:

  • Spring XML config: test-config.xml
  • Kustvakt config: kustvakt-test.conf
  • JDBC config: test-jdbc.properties
  • Hibernate config: test-hibernate.properties

since these files are not included in the jar.

Running Kustvakt jar in the Test Environment

java -jar Kustvakt-full-[versionNumber].jar --spring-config data/test-config.xml
Clone this wiki locally