Skip to content

Commit

Permalink
hm
Browse files Browse the repository at this point in the history
  • Loading branch information
jnatten committed Dec 6, 2023
1 parent 02907dd commit a17dc6a
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package no.ndla.learningpathapi.controller

import cats.implicits._
import no.ndla.common.errors.{AccessDeniedException, ValidationException}
import no.ndla.common.errors.{AccessDeniedException, NotFoundException, ValidationException}
import no.ndla.learningpathapi.integration.DataSource
import no.ndla.learningpathapi.model.api.{Error, ErrorHelpers, ValidationError}
import no.ndla.learningpathapi.model.domain._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ case class ElasticIndexingException(message: String) extends RuntimeExcepti
class ResultWindowTooLargeException(message: String) extends RuntimeException(message)
case class LanguageNotSupportedException(message: String) extends RuntimeException(message)
case class SearchException(message: String) extends RuntimeException(message)
case class NotFoundException(message: String) extends RuntimeException(message)
case class TaxonomyUpdateException(message: String) extends RuntimeException(message)
case class InvalidOembedResponse(message: String) extends RuntimeException(message)
case class MissingIdException(message: String) extends RuntimeException(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ package no.ndla.learningpathapi.service

import cats.implicits._
import io.lemonlabs.uri.typesafe.dsl._
import no.ndla.common.{Clock, errors, model}
import no.ndla.common.errors.ValidationException
import no.ndla.common.errors.NotFoundException
import no.ndla.common.model.domain.learningpath
import no.ndla.common.model.domain.learningpath.{EmbedType, EmbedUrl}
import no.ndla.common.model.{api => commonApi, domain => common}
import no.ndla.language.Language.{AllLanguages, UnknownLanguage, findByLanguageOrBestEffort, getSearchLanguage, mergeLanguageFields}
import no.ndla.common.{Clock, errors}
import no.ndla.language.Language._
import no.ndla.learningpathapi.Props
import no.ndla.learningpathapi.integration._
import no.ndla.learningpathapi.model.api.{LearningPathStatus => _, _}
Expand All @@ -26,14 +26,10 @@ import no.ndla.learningpathapi.repository.LearningPathRepositoryComponent
import no.ndla.learningpathapi.validation.{LanguageValidator, LearningPathValidator}
import no.ndla.mapping.License.getLicense
import no.ndla.myndla.model.api.config
import no.ndla.myndla.model.api.config.ConfigMetaRestricted
import no.ndla.myndla.model.domain.config.ConfigMeta
import no.ndla.network.ApplicationUrl
import no.ndla.network.tapir.auth.Permission.LEARNINGPATH_API_ADMIN
import no.ndla.network.tapir.auth.TokenUser

import java.util.UUID
import scala.annotation.tailrec
import scala.util.{Failure, Success, Try}

trait ConverterService {
Expand All @@ -48,14 +44,7 @@ trait ConverterService {
val converterService: ConverterService

class ConverterService {
import props.{
DefaultLanguage,
Domain,
InternalImageApiUrl,
NdlaFrontendHost,
NdlaFrontendHostNames,
NdlaFrontendProtocol
}
import props._

def asEmbedUrlV2(embedUrl: api.EmbedUrlV2, language: String): EmbedUrl = {
learningpath.EmbedUrl(embedUrl.url, language, EmbedType.valueOfOrError(embedUrl.embedType))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ package no.ndla.learningpathapi.service

import cats.implicits._
import no.ndla.common.Clock
import no.ndla.common.errors.{AccessDeniedException, ValidationException}
import no.ndla.common.errors.{AccessDeniedException, NotFoundException, ValidationException}
import no.ndla.common.model.{api => commonApi}
import no.ndla.learningpathapi.model.api._
import no.ndla.learningpathapi.model.domain
import no.ndla.learningpathapi.model.domain.UserInfo.LearningpathTokenUser
import no.ndla.learningpathapi.model.domain.{StepStatus, LearningPathStatus => _, _}
import no.ndla.learningpathapi.model.{api, domain}
import no.ndla.learningpathapi.model.domain.{StepStatus, LearningPathStatus => _}
import no.ndla.learningpathapi.repository.LearningPathRepositoryComponent
import no.ndla.myndla.model.api.config.ConfigMetaRestricted
import no.ndla.myndla.model.domain.InvalidStatusException
import no.ndla.myndla.model.domain.config.{BooleanValue, ConfigKey, StringListValue}
import no.ndla.myndla.repository.{ConfigRepository, FolderRepository, UserRepository}
import no.ndla.myndla.service.ConfigService
import no.ndla.network.clients.{FeideApiClient, RedisClient}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package no.ndla.learningpathapi.service

import cats.implicits._
import no.ndla.common.Clock
import no.ndla.common.errors.AccessDeniedException
import no.ndla.common.errors.{AccessDeniedException, NotFoundException}
import no.ndla.common.implicits._
import no.ndla.learningpathapi.Props
import no.ndla.learningpathapi.integration.{SearchApiClient, TaxonomyApiClient}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class CloneFolderTest

when(feideApiClient.getFeideID(any)).thenReturn(Success("q"))
when(feideApiClient.getFeideAccessTokenOrFail(any)).thenReturn(Success("notimportante"))
when(feideApiClient.getFeideGroups(any)).thenReturn(Success(Seq.empty))
when(feideApiClient.getFeideExtendedUser(any))
.thenReturn(Success(FeideExtendedUserInfo("", Seq("employee"), "[email protected]", Seq("[email protected]"))))
when(feideApiClient.getOrganization(any)).thenReturn(Success("zxc"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package no.ndla.learningpathapi.service

import no.ndla.common.errors.ValidationException
import no.ndla.common.errors.{NotFoundException, ValidationException}
import no.ndla.common.model.{NDLADate, api => commonApi}
import no.ndla.common.model.domain.learningpath.{EmbedType, EmbedUrl, LearningpathCopyright}
import no.ndla.common.model.domain.{Tag, Title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package no.ndla.learningpathapi.service

import no.ndla.common.errors.AccessDeniedException
import no.ndla.common.errors.{AccessDeniedException, NotFoundException}
import no.ndla.common.model.NDLADate
import no.ndla.common.model.domain.learningpath.LearningpathCopyright
import no.ndla.common.model.domain.{Author, Title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@
package no.ndla.learningpathapi.service

import no.ndla.common.model.{NDLADate, api => commonApi, domain => common}
import no.ndla.common.errors.{AccessDeniedException, ValidationException}
import no.ndla.common.errors.{AccessDeniedException, NotFoundException, ValidationException}
import no.ndla.common.model.domain.{Author, Title}
import no.ndla.common.model.domain.learningpath.LearningpathCopyright
import no.ndla.learningpathapi._
import no.ndla.learningpathapi.model._
import no.ndla.learningpathapi.model.api.{
NewCopyLearningPathV2,
NewLearningPathV2,
NewLearningStepV2,
UpdatedLearningPathV2,
UpdatedLearningStepV2
}
import no.ndla.learningpathapi.model.api.{NewCopyLearningPathV2, NewLearningPathV2, NewLearningStepV2, UpdatedLearningPathV2, UpdatedLearningStepV2}
import no.ndla.learningpathapi.model.domain._
import no.ndla.myndla.model.api.config.ConfigMetaValue
import no.ndla.myndla.model.domain.config.{ConfigKey, ConfigMeta}
Expand Down

0 comments on commit a17dc6a

Please sign in to comment.