Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 15, 2019

Also add MapperTests.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 15, 2019
@chingor13 chingor13 changed the title Port @DocumentId to server SDK Firestore: Port @DocumentId to server SDK Jul 17, 2019
Copy link
Contributor

@BenWhitehead BenWhitehead left a comment

Choose a reason for hiding this comment

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

A few small questions, nothing major.

I assume this is being ported from the android SDK, is there a bread crumb we can to that implementation for a record of where this code is coming from?

return data == null ? null : CustomClassMapper.convertToCustomClass(getData(), valueType);
return data == null
? null
: CustomClassMapper.convertToCustomClass(getData(), valueType, docRef);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it valid to pass data in here, rather than calling getData() again?

Copy link
Author

Choose a reason for hiding this comment

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

Yes,

import java.util.Map;

/** A set of utilities for tests */
public class TestUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be package local since it's only used for firestore tests?

Copy link
Author

Choose a reason for hiding this comment

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

Done.

<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
<scope>test</scope>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate dependency declaration, and formatting in consistent with the rest of the file.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

}

/** Holds information a deserialization operation needs to complete the job. */
static class DeserializeContext {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason this is package-private instead of private?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #5743 into master will increase coverage by 0.75%.
The diff coverage is 77.77%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5743      +/-   ##
============================================
+ Coverage     46.42%   47.17%   +0.75%     
- Complexity    23633    25115    +1482     
============================================
  Files          2389     2389              
  Lines        254506   259831    +5325     
  Branches      28467    29420     +953     
============================================
+ Hits         118144   122582    +4438     
- Misses       127547   128321     +774     
- Partials       8815     8928     +113
Impacted Files Coverage Δ Complexity Δ
...a/com/google/cloud/firestore/DocumentSnapshot.java 85.71% <0%> (ø) 55 <0> (ø) ⬇️
...java/com/google/cloud/firestore/QuerySnapshot.java 68.51% <100%> (+1.21%) 9 <0> (ø) ⬇️
.../com/google/cloud/firestore/CustomClassMapper.java 77.29% <77.87%> (+36.54%) 102 <1> (+47) ⬆️
...re/src/main/java/com/google/cloud/BaseService.java 55.55% <0%> (-6.95%) 2% <0%> (ø)
...re/src/main/java/com/google/cloud/RetryHelper.java 50% <0%> (-3.85%) 2% <0%> (ø)
...le/cloud/compute/deprecated/DeprecationStatus.java 88.63% <0%> (-3.13%) 20% <0%> (ø)
...m/google/cloud/tasks/v2beta3/CloudTasksClient.java 57.43% <0%> (-2.68%) 67% <0%> (+16%)
...va/com/google/cloud/tasks/v2/CloudTasksClient.java 57.43% <0%> (-2.68%) 67% <0%> (+16%)
...m/google/cloud/tasks/v2beta2/CloudTasksClient.java 57.14% <0%> (-2.39%) 79% <0%> (+19%)
...oogle/cloud/firestore/v1/FirestoreAdminClient.java 59.84% <0%> (-2.23%) 38% <0%> (+8%)
... and 649 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41551f5...e6af407. Read the comment docs.

Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

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

The best doc i can find explaining this is https://docs.google.com/document/d/1seUfCzHSv7WXJgoJrtVMCh36HTco7lIrMHZlwCErs40/edit?usp=sharing

Requires corp account to view.

<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
<scope>test</scope>
</dependency>
Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

return data == null ? null : CustomClassMapper.convertToCustomClass(getData(), valueType);
return data == null
? null
: CustomClassMapper.convertToCustomClass(getData(), valueType, docRef);
Copy link
Author

Choose a reason for hiding this comment

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

Yes,

import java.util.Map;

/** A set of utilities for tests */
public class TestUtil {
Copy link
Author

Choose a reason for hiding this comment

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

Done.

}

/** Holds information a deserialization operation needs to complete the job. */
static class DeserializeContext {
Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@BenWhitehead
Copy link
Contributor

Thanks for addressing my comments and adding the link to the doc @hui-wu.

Can you run the code formatter again, that is one of the builds that are currently failing.

import java.util.Map;

/** A set of utilities for tests */
class TestUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

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

LGTM, but please merge the two TestUtil classes.

@BenWhitehead BenWhitehead merged commit 2b28ae1 into googleapis:master Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants