box / mojito

An automation platform that enables continuous localization.
https://www.mojito.global/
Apache License 2.0
370 stars 73 forks source link

Box SDK Update #980

Closed wadimw closed 1 year ago

wadimw commented 1 year ago

Updated Box SDK dependency to latest to fix connections over authenticated proxy.

Additionally, fixed Box SDK related tests DropServiceBoxTests, which got out of sync with filesystem DropServiceTests due to being @Ignored.

Test

  1. In webapp/src/test/java/com/box/l10n/mojito/service/drop/DropServiceBoxTest.java:32 comment out annotation @Ignore. Build with ./mvnw clean install -DskipTests=true.

  2. Create file $HOME/.l10n/config/webapp/application-test.properties and fill the following properties

    
    l10n.boxclient.clientId=
    l10n.boxclient.clientSecret=
    l10n.boxclient.publicKeyId=
    l10n.boxclient.privateKey=
    l10n.boxclient.privateKeyPassword=
    l10n.boxclient.enterpriseId=
    l10n.boxclient.appUserId=

l10n.boxclient.rootFolderId= l10n.boxclient.dropsFolderId=

according to this doc https://www.mojito.global//docs/guides/integrating-with-box/.

3. Create drop folder structure on Box (`mojito` > `Project Requests` as per https://www.mojito.global//docs/guides/integrating-with-box/) and fill properties `rootFolderId` and `dropsFolderId` accordingly.

4. Run

./mvnw test -Dtest='BoxAPIConnectionProviderTest,BoxSDKServiceTest,BoxDropExporterTest,BoxDropImporterTest' -DfailIfNoTests=false


4. Run

./mvnw test -Dtest='DropServiceBoxTest' -DfailIfNoTests=false


(this is a slow test ~7 min)
This test is running separately because it does some context stuff (see `@Ignore` annotation and mention of `@DirtiesContext`) which breaks BoxDropExporterTest for some reason. I don't know Spring enough to fix this right now, but at least it passes when run separately so I think it's fine.
wadimw commented 1 year ago

@ehoogerbeets for some unknown reason in order to merge #979 I had to rebase it onto legacy - even though it was already on top it. This created duplicate commits and messed up this PR. Please re-approve