Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyhappydan committed Sep 20, 2023
1 parent 7023838 commit 78f1dcd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ plugins.composite-views {
# the maximum batching duration. In this window, duplicated persistence ids are discarded
max-time-window = 500 millis
}
# the credentials for comminication with the remote source
remote-source-credentials {
type: "anonymous"
}
# the minimum allowed value for periodic rebuild strategy
min-interval-rebuild = 30 minutes
# the interval at which a view will look for requested restarts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class DeltaClientSpec

implicit private val httpCfg: HttpClientConfig = httpClientConfig
private val deltaClient =
DeltaClient(HttpClient(), AuthTokenProvider.anonymousForTest, Credentials.Anonymous, 1.second)
DeltaClient(HttpClient(), AuthTokenProvider.fixedForTest(token), Credentials.Anonymous, 1.second)

private val source = RemoteProjectSource(
iri"http://example.com/remote-project-source",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ object AuthTokenProvider {
KeyValueStore[ClientCredentials, ParsedToken]().map(cache => new CachingOpenIdAuthTokenProvider(authService, cache))
}
def anonymousForTest: AuthTokenProvider = new AnonymousAuthTokenProvider
def fixedForTest(token: String): AuthTokenProvider = new AuthTokenProvider {
override def apply(credentials: Credentials): UIO[Option[AuthToken]] = UIO.pure(Some(AuthToken(token)))
}
}

private class AnonymousAuthTokenProvider extends AuthTokenProvider {
Expand Down

0 comments on commit 78f1dcd

Please sign in to comment.