-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,15 @@ package fi.oph.viestinvalitys | |
|
||
import fi.oph.viestinvalitys.vastaanotto.resource.LahetysAPIConstants | ||
import fi.oph.viestinvalitys.migraatio.LambdaHandler | ||
import fi.oph.viestinvalitys.util.{AwsUtil, ConfigurationUtil} | ||
import fi.oph.viestinvalitys.util.{AwsUtil, ConfigurationUtil, DbUtil} | ||
import org.apache.commons.io.IOUtils | ||
import software.amazon.awssdk.core.sync.RequestBody | ||
import software.amazon.awssdk.services.s3.model.{CreateBucketRequest, ListObjectsRequest, PutObjectRequest} | ||
import software.amazon.awssdk.services.ses.model.{ConfigurationSet, CreateConfigurationSetEventDestinationRequest, CreateConfigurationSetRequest, EventDestination, EventType, SNSDestination, VerifyDomainIdentityRequest} | ||
import software.amazon.awssdk.services.sns.model.{CreateTopicRequest, SubscribeRequest} | ||
import software.amazon.awssdk.services.sqs.model.{CreateQueueRequest, ListQueuesRequest} | ||
import com.amazonaws.services.lambda.runtime.{ClientContext, CognitoIdentity, Context, LambdaLogger} | ||
import fi.oph.viestinvalitys.business.{KantaOperaatiot, Kontakti, Prioriteetti} | ||
|
||
import java.util.UUID | ||
import scala.beans.BeanProperty | ||
|
@@ -161,6 +162,72 @@ object LocalUtil { | |
|
||
// ajetaan migraatiolambdan koodi | ||
new LambdaHandler().handleRequest(null, new TestAwsContext("migraatio")) | ||
|
||
// alustetaan data | ||
val kantaOperaatiot = new KantaOperaatiot(DbUtil.database) | ||
if(kantaOperaatiot.getLahetykset(Option.empty, Option.apply(20)).isEmpty) { | ||
// lähetystä joissa useita viestejä | ||
/* | ||
otsikko: String, | ||
omistaja: String, lahettavaPalvelu: String, | ||
lahettavanVirkailijanOID: Option[String], | ||
lahettaja: Kontakti, | ||
replyTo: Option[String], | ||
prioriteetti: Prioriteetti, | ||
sailytysAika: Int | ||
*/ | ||
val lahetys = kantaOperaatiot.tallennaLahetys( | ||
"Testiotsikko", | ||
"omistaja", | ||
"hakemuspalvelu", | ||
Option.apply("0.1.2.3"), | ||
Kontakti(Option.apply("Testi Virkailija"), "[email protected]"), | ||
Option.apply("[email protected]"), | ||
Prioriteetti.NORMAALI, | ||
365 | ||
) | ||
val lahetys2 = kantaOperaatiot.tallennaLahetys( | ||
"Testiotsikko2", | ||
"omistaja", | ||
"hakemuspalvelu", | ||
Option.apply("0.1.2.3"), | ||
Kontakti(Option.apply("Testi Virkailija"), "[email protected]"), | ||
Option.apply("[email protected]"), | ||
Prioriteetti.NORMAALI, | ||
365 | ||
) | ||
val lahetys3 = kantaOperaatiot.tallennaLahetys( | ||
"Testiotsikko3", | ||
"omistaja", | ||
"osoitepalvelu", | ||
Option.apply("0.1.2.3"), | ||
Kontakti(Option.apply("Testi Virkailija"), "[email protected]"), | ||
Option.apply("[email protected]"), | ||
Prioriteetti.NORMAALI, | ||
365 | ||
) | ||
/* | ||
otsikko: String, | ||
sisalto: String, | ||
sisallonTyyppi: SisallonTyyppi, | ||
kielet: Set[Kieli], | ||
maskit: Map[String, Option[String]], | ||
lahettavanVirkailijanOID: Option[String], | ||
lahettaja: Option[Kontakti], | ||
replyTo: Option[String], | ||
vastaanottajat: Seq[Kontakti], | ||
liiteTunnisteet: Seq[UUID], | ||
lahettavaPalvelu: Option[String], | ||
lahetysTunniste: Option[UUID], | ||
prioriteetti: Option[Prioriteetti], | ||
sailytysAika: Option[Int], | ||
kayttooikeusRajoitukset: Set[String], | ||
metadata: Map[String, Seq[String]], | ||
omistaja: String | ||
*/ | ||
//kantaOperaatiot.tallennaViesti() | ||
} | ||
|
||
} | ||
|
||
class LocalUtil {} |