Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed Jun 14, 2024
1 parent 1b62569 commit 0ec903b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import org.radarbase.jersey.auth.AuthValidator
import org.radarbase.jersey.auth.disabled.DisabledAuthValidator
import org.radarbase.jersey.config.ConfigLoader

// These tests are ok, but the injection of the DisabledAuthValidator is not correct.
// I do not know how to fix it.
class DashboardIntegrationTest : JerseyTest() {

lateinit var disabledAuthValidator: DisabledAuthValidator
Expand All @@ -56,7 +58,7 @@ class DashboardIntegrationTest : JerseyTest() {
return GrizzlyWebTestContainerFactory()
}

// See https://stackoverflow.com/questions/37902211/test-case-for-testing-a-jersey-web-resource-using-grizzle-is-giving-me-404
// See https://stackoverflow.com/questions/37902211/test-case-for-testing-a-jersey-web-resource-using-grizzly-is-giving-me-404
override fun configureDeployment(): DeploymentContext {
return ServletDeploymentContext.forServlet(ServletContainer(configure())).build()
}
Expand All @@ -70,7 +72,7 @@ class DashboardIntegrationTest : JerseyTest() {

@Test
fun testGetObservationsNoToken() {
val response = target("project/project-1/sub-1/topic/phone_battery_level/observations").request().get()
val response = target("project/project-1/subject/sub-1/topic/phone_battery_level/observations").request().get()
Assertions.assertEquals(401, response.status)
}

Expand Down
4 changes: 4 additions & 0 deletions data-dashboard-backend/src/test/resources/dashboard_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ database:
dialect: org.hibernate.dialect.H2Dialect
liquibase:
contexts: [dev]
properties:
hibernate.globally_quoted_identifiers: true
hibernate.physical_naming_strategy: org.radarbase.datadashboard.api.domain.model.CamelCaseToUppercaseColumnNamingStrategy

0 comments on commit 0ec903b

Please sign in to comment.