Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix InMemoryFileTest#file_with_only_text #931

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ application-*.properties
!application-test.properties
.env
target/
mockstorage/
mock_storage/
.DS_Store
static-front/
logs/
Expand Down Expand Up @@ -42,5 +42,4 @@ tmp
!.elasticbeanstalk/*.global.yml

# Used in test
7fdad8b1*

7fdad8b1*
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ Create a new folder `mock_storage` to store files.
Create the file `application-dev.properties` in `dossierfacile-bo/src/main/resources`

```properties
mock.storage.path=/path/to/mock_storage/
server.port=8081
application.name=bo
application.domain=http://localhost:8081
domain.protocol=http
environment=localhost

mock.storage.path=mockstorage
storage.provider.list=LOCAL
mock.storage.path=mock_storage

# SQL
spring.datasource.url=jdbc:postgresql://localhost:5432/dossierfacile
Expand Down Expand Up @@ -82,7 +81,7 @@ brevo.apikey=
Create the file `application-dev.properties` in `dossierfacile-api-tenant/src/main/resources`

```properties
mock.storage.path=/path/to/mock_storage/
mock.storage.path=mock_storage
storage.provider.list=LOCAL
api.version=3
tenant.base.url=localhost:9002
Expand All @@ -106,7 +105,7 @@ brevo.apikey=
Create the file `application-dev.properties` in `dossierfacile-api-owner/src/main/resources`

```properties
mock.storage.path=/path/to/mock_storage/
mock.storage.path=mock_storage
owner.url=http://localhost:3000
server.port=8083
# SQL
Expand All @@ -129,7 +128,7 @@ brevo.apikey=
Create the file `application-dev.properties` in `dossierfacile-process-file/src/main/resources`

```properties
mock.storage.path=/path/to/mock_storage/
mock.storage.path=mock_storage
storage.provider.list=LOCAL
server.port=8088
# SQL
Expand All @@ -149,7 +148,7 @@ Create the file `application-dev.properties` in `dossierfacile-api-watermark/src

```properties
server.port=8091
mock.storage.path=/path/to/mock_storage/
mock.storage.path=mock_storage
storage.provider.list=LOCAL
# SQL
spring.datasource.url=jdbc:postgresql://localhost:5433/dossierfacile
Expand All @@ -160,7 +159,7 @@ spring.datasource.password=
Create the file `application-dev.properties` in `dossierfacile-pdf-generator/src/main/resources`

```properties
mock.storage.path=/path/to/mock_storage/
mock.storage.path=mock_storage
storage.provider.list=LOCAL
# SQL
spring.datasource.url= jdbc:postgresql://localhost:5433/dossierfacile
Expand Down Expand Up @@ -244,4 +243,4 @@ Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)
[MIT](https://choosealicense.com/licenses/mit/)
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ void file_with_only_text() throws IOException {

assertThat(inMemoryPdfFile.hasQrCode()).isFalse();
assertThat(inMemoryPdfFile.has2DDoc()).isFalse();
assertThat(inMemoryPdfFile.getContentAsString()).isEqualTo("""


Test document


""");
assertThat(inMemoryPdfFile.getContentAsString()).isNotEmpty();
assertThat(inMemoryPdfFile.getContentAsString().trim()).isEqualTo("Test document");
}

private FileStorageService classpathStorageService() throws IOException {
Expand Down