As online customer
I want app to automatically load my latest image feed
So i can always enjoy newest images of friends
Given the customer have connectivity
When the customer requests to see their image feed
Then the app should display latest image feed from remote
And replace cache with new image feed
As offline customer
I want app to automatically load cached image feed
So i can always enjoy cached images while offline
Given the customer doesn't have connectivity
And there is a cached version of the image feed
And the cache is less then 7 days old
When the customer request to show the image feed
Then the app displays cache image feed
Given the customer doesn't have connectivity
And there is a cached version of the image feed
And the cache is 7 days old or more
When the customer request to show the image feed
Then the app displays error message
Given the customer doesn't have connectivity
And the cache is empty
When the customer request to show the image feed
Then the app displays error message
- URL
- Execute "Load Image Feed" command with above data
- System downloads data from URL
- System validates downloaded data
- System creates image feed from valid data
- System delivers image feed
- System delivers invalid data error
- System delivers connectivity error
- URL
- Execute "Load Image Data" command with above data
- System downloads data from URL
- System validates downloaded data
- System delivers image
- System does not deliver image data nor error
- System delivers invalid data error
- System delivers connectivity error
- URL
- Execute "Load Image Feed" command with above data
- System retrieves image feed data from cache
- System validates cache is less then 7 days old
- System creates image feed from valid data
- System delivers image feed
- System delivers retrieval error
- System delivers no feed images
- System delivers no feed images
- URL
- Execute "Load Image Data" command with above data
- System retrieves image data from cache
- System delivers image feed
- System does not deliver image data nor error
- System delivers retrieval error
- System delivers not found error
- Execute "Validate Feed Cache" command
- System retrieves image feed data from cache
- System validates cache is less then 7 days old
- System deletes cache
- System deletes cache
- Image Feed
- Execute "Save Image Feed" command with above data
- System deletes old cache
- System encodes new image feed
- System timestamps encoded image feed
- System saves new cached data
- System delivers susccess message
- System delivers error
- System deletes cache
Property | Type |
---|---|
id |
UUID |
description |
String (optional) |
location |
String (optional) |
url |
URL |
GET /feed
200 RESPONSE
{
"items": [
{
"id": "a UUID",
"description": "a description",
"location": "a location",
"image": "https://a-image.url",
},
{
"id": "another UUID",
"description": "another description",
"image": "https://another-image.url"
},
{
"id": "even another UUID",
"location": "even another location",
"image": "https://even-another-image.url"
},
{
"id": "yet another UUID",
"image": "https://yet-another-image.url"
}
...
]
}