et_fake_ccd 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -0
- data/lib/et_fake_ccd.rb +3 -1
- data/lib/et_fake_ccd/cli/root.rb +9 -0
- data/lib/et_fake_ccd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 222da7c19a6414c1a8fbfaa7f2026085f3d27909c048dab3b2aa14f6ba40b6d2
|
4
|
+
data.tar.gz: 2a7185247e4b6e1427b567c4ac8ce74d859bc48f337180ee37dc689dd5a40db9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a503eaf45755544233ed09eb4f68ab120b0867b00de6be3e93bc52baa52e0cf535851d1fa0c378ee6cf1a4cd7d80be6cad2e6878d1604cfff640f6e2faba0901
|
7
|
+
data.tar.gz: 4df9c0162603be5d327a8b504799a11faceed3e151cdb6eae79af9f9b45062928630e1a4441956589400691957826a967f2c7939099781851bd9e3b40faf96bc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -31,6 +31,16 @@ To run the server, use the command
|
|
31
31
|
et_fake_ccd start
|
32
32
|
```
|
33
33
|
|
34
|
+
or if you want to specify which json schema file you want to use for validation (no default
|
35
|
+
is provided as it changes in CCD regularly using the config file), you can either specify the otion
|
36
|
+
'create_case_schema' as shown below OR you can specify the environment variable ET_FAKE_CCD_CREATE_CASE_SCHEMA instead.
|
37
|
+
|
38
|
+
The 'master' definition of this file is here https://raw.githubusercontent.com/hmcts/et-ccd-export/develop/spec/json_schemas/case_create.json
|
39
|
+
so use wget or curl etc.. or just a browser to download it if you want real life validation.
|
40
|
+
|
41
|
+
```
|
42
|
+
et_fake_ccd start --create_case_schema=<path_to_file>
|
43
|
+
```
|
34
44
|
## Testing Using This Fake Server
|
35
45
|
|
36
46
|
In general, this server will try to act like the normal CCD server but only in terms of accepting
|
data/lib/et_fake_ccd.rb
CHANGED
data/lib/et_fake_ccd/cli/root.rb
CHANGED
@@ -10,7 +10,16 @@ module EtFakeCcd
|
|
10
10
|
|
11
11
|
desc "start", "Run multiple services on one port"
|
12
12
|
method_option :port, type: :numeric, default: 8080
|
13
|
+
method_option :create_case_schema, type: :string, default: ENV.fetch('ET_FAKE_CCD_CREATE_CASE_SCHEMA', nil)
|
14
|
+
|
13
15
|
def start
|
16
|
+
if options.create_case_schema && !File.exist?(options.create_case_schema)
|
17
|
+
puts "Error - The file #{options.create_case_schema} does not exist."
|
18
|
+
return
|
19
|
+
end
|
20
|
+
::EtFakeCcd.config do |c|
|
21
|
+
c.create_case_schema_file = options.create_case_schema
|
22
|
+
end
|
14
23
|
Rack::Server.start app: EtFakeCcd::RootApp, Port: options.port, server: 'iodine'
|
15
24
|
end
|
16
25
|
end
|
data/lib/et_fake_ccd/version.rb
CHANGED