16 Commits

Author SHA1 Message Date
Tom Pallister
fef19ddf98
Changed routing to support a catch all style (#187)
* Changed routing to support a catch all style

* refactoring placeholder tuff

* implemented simple priority in the routing
2018-01-05 21:26:15 +00:00
Charalampos Chomenidis
48b5a32676 Implement mapping of HttpResponseMessage to CachedResponse to fix #152 (#153)
* changed name to cache options to fix issue #146

* Add acceptance test that exposes JSON deserialization bug from issue #146

- Create InMemoryJsonHandle for CacheManager that mimics DictionaryHandle but uses ICacheSerializer to serialize/deserialize values instead of saving references
- Add CacheManager.Serialization.Json package
- Add StartupWithCustomCacheHandle class that extends Startup and overrides ConfigureServices to register InMemoryJsonHandle
- Add GivenOcelotIsRunningUsingConsulToStoreConfigAndJsonSerializedCache method to initiate Ocelot with StartupWithCustomCacheHandle
- Add test should_return_response_200_with_simple_url_when_using_jsonserialized_cache

* Create Acceptance test that exposes issue #152

- Add GivenOcelotIsRunningUsingJsonSerializedCache() that initializes Ocelot with InMemoryJsonHandle
- Add should_return_cached_response_when_using_jsonserialized_cache test

* Change Consul port to 9502 on should_return_response_200_with_simple_url_when_using_jsonserialized_cache() test

* Implement mapping of HttpResponseMessage to CachedResponse to enable distributed caching

- Add CachedResponse class that holds HttpResponse data
- Add mapping methods in OutputCacheMiddleware to create HttpResponseMessage from CachedResponse and vice versa
- Replace HttpResponseMessage with CachedResponse in services registrations
- Replace HttpResponseMessage with CachedResponse in OutputCacheController's IOcelotCache

* Fix unit tests for OutputCacheMiddleware and OutputCacheController by replacing HttpResponseMessage with CachedResponse

* Add .editorconfig with default identation settings (spaces with size 4)

* Re-format broken files with new identation settings

* Add Startup_WithConsul_And_CustomCacheHandle class

- Use Startup_WithConsul_And_CustomCacheHandle in GivenOcelotIsRunningUsingConsulToStoreConfigAndJsonSerializedCache step

* Do minor cleanups

- Rename StartupWithCustomCacheHandle to Startup_WithCustomCacheHandle for better readability
- Remove cachemanager settings Action in Startup since it is not used anymore

* Drop Task in CreateHttpResponseMessage - unnecessary overhead

* Make setters private in CachedResponse

- Rework CreateCachedResponse to use new CachedResponse constructor
2017-11-25 14:47:17 +00:00
Philip Wood
d02e921a58 Moved ScopedRepository into test base class. 2017-07-18 10:53:57 +01:00
Philip Wood
84743ede0e Fix some test-related build warnings 2017-07-18 09:31:26 +01:00
Philip Wood
8042bbab2c Moved common middleare test setup into a base class 2017-07-18 09:28:32 +01:00
Tom Gardham-Pallister
0f60a353ef now set region in config...or it defaults to something 2017-06-28 19:02:08 +01:00
Tom Gardham-Pallister
ab953f28fd realised the user can just set the region..delete time 2017-06-28 08:17:48 +01:00
Tom Gardham-Pallister
0fa759c76c first acceptance test failing.. 2017-06-27 19:07:55 +01:00
Tom Gardham-Pallister
e4e7fcc943 unit tests for cache clearing passing 2017-06-27 18:54:15 +01:00
Tom Gardham-Pallister
239dcfb6bd working on region clearing cache, if using cachemanager back plance this would clear all servers in cluster 2017-06-26 19:10:20 +01:00
Juan Carlos Santana Herrera
24f7b9a171 UpstreamHttpMethod property (of class FileReRoute) changes from string to List<string>. 2017-05-05 11:47:28 +01:00
Philip Wood
7c1a277147 Fixed some unit tests 2017-04-18 14:05:15 +01:00
Tom Gardham-Pallister
33ce162693 changed upstream http method to use httpmethod class in .net 2017-02-07 18:30:21 +00:00
TomPallister
af506b079a more logging, more readme, more refactoring 2016-11-05 11:36:58 +00:00
TomPallister
8582ba45a9 Added some logging at last! 2016-11-04 20:17:15 +00:00
TomPallister
47afc850ff Added some basic cache stuff 2016-11-04 15:05:59 +00:00