-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
Added tests for collectionsDiffer.
differ/collectionsDiffer.go
Outdated
return &defaultCollectionsDiffer{} | ||
} | ||
|
||
func (dcd *defaultCollectionsDiffer) Diff(incomingCollectionUuids []string, oldCollectionUuids []string) ([]string, map[string]bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just return only the map from this function? The keys from the isDeleted
map are the uuids of the content that was added/deleted.
Added healthcheck for relations resolver.
contentResolverHealthURI string | ||
relationsResolverHealthURI string | ||
producer producer.MessageProducer | ||
client *http.Client | ||
} | ||
|
||
func newHealthService(config *healthConfig) *healthService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gtg healthcheck should be done in parallel. There is an example in the methode-content-placeholder-mapper
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
"io/ioutil" | ||
"net/http" | ||
|
||
"github.com/Financial-Times/transactionid-utils-go" | ||
) | ||
|
||
type ContentResolver interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test the flow where the httpClient can't make the call to the contentResolverApp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot test this, because of go not having an interface for http client.
|
||
resp, err := drr.httpClient.Do(req) | ||
if err != nil { | ||
return nil, fmt.Errorf("Error doing request to uri=[%v], transaction_id=[%v].", completeUri, tid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flow can be tested as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot test this, because of go not having an interface for http client.
differ/collectionsDiffer.go
Outdated
} | ||
|
||
func oneWayDiff(firstCollection []string, secondCollection []string, markDeleted bool, mapToAdd map[string]bool) { | ||
secondCollectionTemp := make(map[string]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of map[string]interface{}
this should be map[string]struct{}
and secondCollectionTemp[secondColUuid]
should be initialized with struct{}{}
.
Added log for testing.
README.md
Outdated
1. **relations-api** connectivity check | ||
2. **content-collection-neo4j-rw** connectivity check | ||
3. **document-store-api** connectivity check | ||
4. **kafka** connectivity check and topic existence check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existence of the kafka topic is no longer checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true
@@ -8,4 +8,6 @@ env: | |||
WRITER_HEALTH_URI: http://content-collection-rw-neo4j:8080/__health | |||
CONTENT_RESOLVER_URI: http://document-store-api:8080/content/ | |||
CONTENT_RESOLVER_HEALTH_URI: http://document-store-api:8080/__health | |||
RELATIONS_RESOLVER_URI: http://relations-api/contentcollection/{uuid}/relations | |||
RELATIONS_RESOLVER_HEALTH_URI: http://relations-api/__health |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should access the relations-api on the 8080 port, like http://relations-api:8080/..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the relations-api URL as its healthcheck is not green.
8c7db3c
to
05c9cd2
Compare
No description provided.