Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jnatten committed Oct 25, 2024
1 parent 8922db0 commit fe47fd6
Show file tree
Hide file tree
Showing 31 changed files with 305 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class ComponentRegistry(properties: ArticleApiProperties)
var e4sClient: NdlaE4sClient = Elastic4sClientFactory.getClient(props.SearchServer)
lazy val searchApiClient = new SearchApiClient
lazy val feideApiClient = new FeideApiClient
lazy val myndlaApiClient = new MyNDLAApiClient
lazy val redisClient = new RedisClient(props.RedisHost, props.RedisPort)
lazy val frontpageApiClient = new FrontpageApiClient

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ trait TestEnvironment
val contentValidator: ContentValidator = mock[ContentValidator]

val ndlaClient: NdlaClient = mock[NdlaClient]
val myndlaApiClient: MyNDLAApiClient = mock[MyNDLAApiClient]
val searchConverterService: SearchConverterService = mock[SearchConverterService]
var e4sClient: NdlaE4sClient = mock[NdlaE4sClient]
val searchApiClient: SearchApiClient = mock[SearchApiClient]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class ComponentRegistry(properties: AudioApiProperties)
lazy val audioRepository = new AudioRepository
lazy val seriesRepository = new SeriesRepository

lazy val ndlaClient = new NdlaClient
lazy val ndlaClient = new NdlaClient
lazy val myndlaApiClient: MyNDLAApiClient = new MyNDLAApiClient

lazy val readService = new ReadService
lazy val writeService = new WriteService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ trait TestEnvironment
val s3Client: NdlaS3Client = mock[NdlaS3Client]

val ndlaClient: NdlaClient = mock[NdlaClient]
val myndlaApiClient: MyNDLAApiClient = mock[MyNDLAApiClient]

val readService: ReadService = mock[ReadService]
val writeService: WriteService = mock[WriteService]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ class ComponentRegistry(properties: ConceptApiProperties)

var e4sClient: NdlaE4sClient = Elastic4sClientFactory.getClient(props.SearchServer)

lazy val ndlaClient = new NdlaClient
lazy val articleApiClient = new ArticleApiClient
lazy val searchApiClient = new SearchApiClient
lazy val ndlaClient = new NdlaClient
lazy val articleApiClient = new ArticleApiClient
lazy val searchApiClient = new SearchApiClient
lazy val myndlaApiClient: MyNDLAApiClient = new MyNDLAApiClient

lazy val importService = new ImportService

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ trait TestEnvironment
val importService: ImportService = mock[ImportService]

val ndlaClient: NdlaClient = mock[NdlaClient]
val myndlaApiClient: MyNDLAApiClient = mock[MyNDLAApiClient]
val articleApiClient: ArticleApiClient = mock[ArticleApiClient]
val searchApiClient: SearchApiClient = mock[SearchApiClient]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ class ComponentRegistry(properties: DraftApiProperties)
lazy val contentValidator = new ContentValidator()
lazy val importValidator = new ContentValidator()

lazy val ndlaClient = new NdlaClient
lazy val searchConverterService = new SearchConverterService
lazy val readService = new ReadService
lazy val writeService = new WriteService
lazy val reindexClient = new ReindexClient
lazy val ndlaClient = new NdlaClient
lazy val myndlaApiClient: MyNDLAApiClient = new MyNDLAApiClient
lazy val searchConverterService = new SearchConverterService
lazy val readService = new ReadService
lazy val writeService = new WriteService
lazy val reindexClient = new ReindexClient

lazy val fileStorage = new FileStorageService

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ trait TestEnvironment
val s3Client: NdlaS3Client = mock[NdlaS3Client]

val ndlaClient: NdlaClient = mock[NdlaClient]
val myndlaApiClient: MyNDLAApiClient = mock[MyNDLAApiClient]
val searchConverterService: SearchConverterService = mock[SearchConverterService]
var e4sClient: NdlaE4sClient = mock[NdlaE4sClient]
override val learningpathApiClient: LearningpathApiClient = mock[LearningpathApiClient]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class ComponentRegistry(properties: FrontpageApiProperties)
override val internController = new InternController
val healthController = new TapirHealthController

override val myndlaApiClient: MyNDLAApiClient = new MyNDLAApiClient
override val ndlaClient: NdlaClient = new NdlaClient

private val swagger = new SwaggerController(
List(
subjectPageController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@ trait TestEnvironment
override val readService: ReadService = mock[ReadService]
override val writeService: WriteService = mock[WriteService]

override val ndlaClient: NdlaClient = mock[NdlaClient]
override val myndlaApiClient: MyNDLAApiClient = mock[MyNDLAApiClient]

def services: List[TapirController] = List.empty
}
27 changes: 14 additions & 13 deletions image-api/src/main/scala/no/ndla/imageapi/ComponentRegistry.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,20 @@ class ComponentRegistry(properties: ImageApiProperties)

lazy val s3Client = new NdlaS3Client(props.StorageName, props.StorageRegion)

lazy val imageIndexService = new ImageIndexService
lazy val imageSearchService = new ImageSearchService
lazy val tagIndexService = new TagIndexService
lazy val tagSearchService = new TagSearchService
lazy val imageRepository = new ImageRepository
lazy val readService = new ReadService
lazy val writeService = new WriteService
lazy val validationService = new ValidationService
lazy val imageStorage = new AmazonImageStorageService
lazy val ndlaClient = new NdlaClient
lazy val converterService = new ConverterService
var e4sClient: NdlaE4sClient = Elastic4sClientFactory.getClient(props.SearchServer)
lazy val searchConverterService = new SearchConverterService
lazy val imageIndexService = new ImageIndexService
lazy val imageSearchService = new ImageSearchService
lazy val tagIndexService = new TagIndexService
lazy val tagSearchService = new TagSearchService
lazy val imageRepository = new ImageRepository
lazy val readService = new ReadService
lazy val writeService = new WriteService
lazy val validationService = new ValidationService
lazy val imageStorage = new AmazonImageStorageService
lazy val ndlaClient = new NdlaClient
lazy val converterService = new ConverterService
var e4sClient: NdlaE4sClient = Elastic4sClientFactory.getClient(props.SearchServer)
lazy val myndlaApiClient: MyNDLAApiClient = new MyNDLAApiClient
lazy val searchConverterService = new SearchConverterService

lazy val imageConverter = new ImageConverter
lazy val clock = new SystemClock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ trait TestEnvironment
val imageStorage: AmazonImageStorageService = mock[AmazonImageStorageService]

val ndlaClient: NdlaClient = mock[NdlaClient]
val myndlaApiClient: MyNDLAApiClient = mock[MyNDLAApiClient]
val rawController: RawController = mock[RawController]
val healthController: HealthController = mock[HealthController]
val internController: InternController = mock[InternController]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,25 @@ package no.ndla.learningpathapi
import com.zaxxer.hikari.HikariDataSource
import no.ndla.common.Clock
import no.ndla.common.configuration.BaseComponentRegistry
import no.ndla.learningpathapi.controller.{InternController, LearningpathControllerV2, StatsController, SwaggerDocControllerConfig}
import no.ndla.learningpathapi.controller.{
InternController,
LearningpathControllerV2,
StatsController,
SwaggerDocControllerConfig
}
import no.ndla.learningpathapi.integration.*
import no.ndla.learningpathapi.model.api.ErrorHandling
import no.ndla.learningpathapi.repository.LearningPathRepositoryComponent
import no.ndla.learningpathapi.service.*
import no.ndla.learningpathapi.service.search.{SearchConverterServiceComponent, SearchIndexService, SearchService}
import no.ndla.learningpathapi.validation.{LanguageValidator, LearningPathValidator, LearningStepValidator, TextValidator, TitleValidator, UrlValidator}
import no.ndla.learningpathapi.validation.{
LanguageValidator,
LearningPathValidator,
LearningStepValidator,
TextValidator,
TitleValidator,
UrlValidator
}
import no.ndla.network.NdlaClient
import no.ndla.network.clients.{FeideApiClient, MyNDLAApiClient, RedisClient}
import no.ndla.network.tapir.TapirApplication
Expand Down
Loading

0 comments on commit fe47fd6

Please sign in to comment.