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

Migrating "spring-cloud-gcp-storage" tests to Junit5 #1023

Merged
merged 2 commits into from
Mar 23, 2022
Merged

Conversation

ddixit14
Copy link
Contributor

Tests Migrated:

  1. GoogleStorageTests.java
  2. GcsInboundFileSynchronizerTests.java
  3. GcsStreamingMessageSourceTests.java
  4. GcsMessageHandlerTests.java
  5. GoogleStorageIntegrationTests.java

String location = "gs://test-spring/test";
Storage storage = mock(Storage.class);
when(storage.get(BlobId.of("test-spring", "test"))).thenReturn(null);

GoogleStorageResource resource = new GoogleStorageResource(storage, location, false);
resource.getInputStream();

assertThatThrownBy(() -> resource.getOutputStream())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resource.getInputStream()

File testFile = this.temporaryFolder.newFile("benfica");
void testNewFiles(@TempDir Path tempDir) throws IOException {

Path testFileOld = tempDir.resolve("benfica");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename testFileOld to testPath to better reflect what it is.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ddixit14 ddixit14 merged commit 98e5899 into main Mar 23, 2022
@ddixit14 ddixit14 deleted the storage-test-mig branch March 23, 2022 14:59
kateryna216 added a commit to kateryna216/spring-cloud-gcp that referenced this pull request Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants