sepafm 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/lib/sepa/application_request.rb +17 -8
- data/lib/sepa/attribute_checks.rb +23 -26
- data/lib/sepa/banks/danske/danske_response.rb +29 -41
- data/lib/sepa/banks/danske/soap_danske.rb +30 -23
- data/lib/sepa/client.rb +8 -11
- data/lib/sepa/response.rb +13 -23
- data/lib/sepa/utilities.rb +2 -6
- data/lib/sepa/version.rb +1 -1
- data/lib/sepa/xml_schemas/danske_pki.xsd +1 -1
- data/lib/sepa/xml_templates/application_request/danske/renew_certificate.xml +33 -0
- data/lib/sepa/xml_templates/soap/danske/renew_certificate.xml +17 -0
- data/readme.md +3 -3
- data/sepafm.gemspec +4 -4
- data/test/custom_assertions.rb +21 -0
- data/test/sepa/banks/danske/danske_cert_soap_builder_test.rb +1 -5
- data/test/sepa/banks/danske/danske_certificate_application_request_test.rb +6 -8
- data/test/sepa/banks/danske/danske_generic_soap_builder_test.rb +7 -23
- data/test/sepa/banks/danske/danske_get_bank_cert_test.rb +3 -13
- data/test/sepa/banks/danske/danske_renew_cert_application_request_test.rb +32 -0
- data/test/sepa/banks/danske/danske_renew_cert_request_soap_builder_test.rb +41 -0
- data/test/sepa/banks/nordea/nordea_application_request_test.rb +4 -16
- data/test/sepa/banks/nordea/nordea_cert_application_request_test.rb +1 -5
- data/test/sepa/banks/nordea/nordea_cert_request_soap_builder_test.rb +1 -4
- data/test/sepa/banks/nordea/nordea_generic_soap_builder_test.rb +7 -23
- data/test/sepa/banks/nordea/nordea_renew_cert_application_request_test.rb +1 -10
- data/test/sepa/banks/nordea/nordea_renew_cert_request_soap_builder_test.rb +1 -10
- data/test/sepa/banks/op/op_application_request_test.rb +3 -30
- data/test/sepa/banks/op/op_cert_application_request_test.rb +1 -10
- data/test/sepa/banks/op/op_cert_request_soap_builder_test.rb +1 -10
- data/test/sepa/banks/op/op_generic_soap_builder_test.rb +2 -20
- data/test/sepa/client_test.rb +42 -66
- data/test/sepa/fixtures.rb +72 -23
- data/test/sepa/sepa_test.rb +1 -1
- data/test_client/test_client.rb +23 -18
- metadata +16 -19
- data/.travis.yml +0 -16
- data/test/sepa/banks/danske/keys/danske_encryption.crt +0 -24
- data/test/sepa/banks/danske/keys/encryption_pkcs.csr +0 -0
- data/test/sepa/banks/danske/keys/signing_pkcs.csr +0 -0
- data/test/sepa/banks/danske/keys/signing_private_key.pem +0 -27
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
|
3
|
+
xmlns:pkif="http://danskebank.dk/PKI/PKIFactoryService">
|
4
|
+
<env:Header/>
|
5
|
+
<env:Body>
|
6
|
+
<pkif:RenewCertificateIn>
|
7
|
+
<pkif:RequestHeader>
|
8
|
+
<pkif:SenderId/>
|
9
|
+
<pkif:CustomerId/>
|
10
|
+
<pkif:RequestId/>
|
11
|
+
<pkif:Timestamp/>
|
12
|
+
<pkif:InterfaceVersion>1</pkif:InterfaceVersion>
|
13
|
+
<pkif:Environment/>
|
14
|
+
</pkif:RequestHeader>
|
15
|
+
</pkif:RenewCertificateIn>
|
16
|
+
</env:Body>
|
17
|
+
</env:Envelope>
|
data/readme.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Devlab / SEPA
|
2
2
|
|
3
|
-
[](https://codeclimate.com/repos/577f932c113b7263ba004849/feed)
|
4
|
+
[](https://codeclimate.com/repos/577f932c113b7263ba004849/coverage)
|
5
|
+
[](https://semaphoreci.com/devlab/sepa)
|
6
6
|
[](http://badge.fury.io/rb/sepafm)
|
7
7
|
|
8
8
|
This project aims to create an open source implementation of SEPA Financial Messages using Web Services. Project implementation is done in Ruby.
|
data/sepafm.gemspec
CHANGED
@@ -16,16 +16,16 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
|
-
spec.required_ruby_version = '>= 2.
|
19
|
+
spec.required_ruby_version = '>= 2.2.5'
|
20
20
|
|
21
21
|
spec.add_dependency 'activemodel', '~> 4.2'
|
22
22
|
spec.add_dependency 'nokogiri', '~> 1.6'
|
23
23
|
spec.add_dependency 'savon', '~> 2.11'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
26
|
-
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.
|
26
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.6'
|
27
27
|
spec.add_development_dependency 'dotenv', '~> 2.1'
|
28
|
-
spec.add_development_dependency 'minitest', '~> 5.
|
29
|
-
spec.add_development_dependency 'rake', '~> 11.
|
28
|
+
spec.add_development_dependency 'minitest', '~> 5.9'
|
29
|
+
spec.add_development_dependency 'rake', '~> 11.2'
|
30
30
|
spec.add_development_dependency 'rubyntlm', '~> 0.6'
|
31
31
|
end
|
data/test/custom_assertions.rb
CHANGED
@@ -11,6 +11,27 @@ module Minitest::Assertions
|
|
11
11
|
"Expected #{ expected.inspect } and #{ actual.inspect } would not have the same items"
|
12
12
|
end
|
13
13
|
|
14
|
+
def assert_valid_against_schema(schema, document)
|
15
|
+
errors = []
|
16
|
+
|
17
|
+
Dir.chdir(SCHEMA_PATH) do
|
18
|
+
xsd = Nokogiri::XML::Schema(IO.read(schema))
|
19
|
+
xsd.validate(document).each do |error|
|
20
|
+
errors << error
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def refute_valid_against_schema(schema, document)
|
28
|
+
Dir.chdir(SCHEMA_PATH) do
|
29
|
+
xsd = Nokogiri::XML::Schema(IO.read(schema))
|
30
|
+
|
31
|
+
refute xsd.valid?(document)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
14
35
|
private
|
15
36
|
|
16
37
|
def same_items(expected, actual)
|
@@ -90,10 +90,6 @@ class DanskeCertSoapBuilderTest < ActiveSupport::TestCase
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def test_should_validate_against_schema
|
93
|
-
|
94
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
95
|
-
assert xsd.valid?(@doc)
|
96
|
-
end
|
93
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
97
94
|
end
|
98
|
-
|
99
95
|
end
|
@@ -2,15 +2,13 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class DanskeCertificateApplicationRequestTest < ActiveSupport::TestCase
|
4
4
|
setup do
|
5
|
-
@
|
6
|
-
@
|
7
|
-
@danske_create_certificate_application_request =
|
8
|
-
Sepa::ApplicationRequest.new @danske_create_certificate_params
|
5
|
+
@params = danske_create_certificate_params
|
6
|
+
@ar = Sepa::ApplicationRequest.new(@params)
|
9
7
|
end
|
10
8
|
|
11
|
-
test '
|
12
|
-
environment_node =
|
13
|
-
|
14
|
-
assert_equal environment_node.content
|
9
|
+
test 'environment is set to customertest when test in parameters' do
|
10
|
+
environment_node = @ar.to_nokogiri.at('tns|Environment')
|
11
|
+
|
12
|
+
assert_equal 'customertest', environment_node.content
|
15
13
|
end
|
16
14
|
end
|
@@ -223,41 +223,25 @@ class DanskeGenericSoapBuilderTest < ActiveSupport::TestCase
|
|
223
223
|
end
|
224
224
|
|
225
225
|
def test_should_validate_against_schema
|
226
|
-
|
227
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
228
|
-
assert xsd.valid?(@doc)
|
229
|
-
end
|
226
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
230
227
|
end
|
231
228
|
|
232
229
|
def test_schema_validation_should_fail_with_wrong_must_understand_value
|
233
|
-
wsse
|
234
|
-
security_node = @doc.at(
|
235
|
-
'//wsse:Security', 'wsse' => wsse
|
236
|
-
)
|
230
|
+
wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
231
|
+
security_node = @doc.at('//wsse:Security', 'wsse' => wsse)
|
237
232
|
|
238
233
|
security_node['env:mustUnderstand'] = '3'
|
239
234
|
|
240
|
-
|
241
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
242
|
-
refute xsd.valid?(@doc)
|
243
|
-
end
|
235
|
+
refute_valid_against_schema 'soap.xsd', @doc
|
244
236
|
end
|
245
237
|
|
246
238
|
def test_should_validate_against_ws_security_schema
|
247
|
-
wsse
|
248
|
-
|
249
|
-
ws_node = @doc.xpath(
|
250
|
-
'//wsse:Security', 'wsse' => wsse
|
251
|
-
)
|
252
|
-
|
239
|
+
wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
240
|
+
ws_node = @doc.xpath('//wsse:Security', 'wsse' => wsse)
|
253
241
|
ws_node = ws_node.to_xml
|
254
|
-
|
255
242
|
ws_node = Nokogiri::XML(ws_node)
|
256
243
|
|
257
|
-
|
258
|
-
xsd = Nokogiri::XML::Schema IO.read 'oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
259
|
-
assert xsd.valid?(ws_node)
|
260
|
-
end
|
244
|
+
assert_valid_against_schema 'oasis-200401-wss-wssecurity-secext-1.0.xsd', ws_node
|
261
245
|
end
|
262
246
|
|
263
247
|
test 'application request is encrypted' do
|
@@ -80,20 +80,14 @@ class DanskeGetBankCertTest < ActiveSupport::TestCase
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def test_should_validate_against_soap_schema
|
83
|
-
|
84
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
85
|
-
assert xsd.valid?(@doc)
|
86
|
-
end
|
83
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
87
84
|
end
|
88
85
|
|
89
86
|
def test_request_should_validate_against_pki_service_schema
|
90
87
|
request = @doc.css('GetBankCertificateRequest', 'xmlns' => @elem).to_xml
|
91
88
|
request = Nokogiri::XML(request)
|
92
89
|
|
93
|
-
|
94
|
-
xsd = Nokogiri::XML::Schema(IO.read('PKIFactory.xsd'))
|
95
|
-
assert xsd.valid?(request)
|
96
|
-
end
|
90
|
+
assert_valid_against_schema 'PKIFactory.xsd', request
|
97
91
|
end
|
98
92
|
|
99
93
|
def test_invalid_bank_root_cert_serial_should_fail_schema_validation
|
@@ -102,10 +96,6 @@ class DanskeGetBankCertTest < ActiveSupport::TestCase
|
|
102
96
|
request = @doc.css('GetBankCertificateRequest', 'xmlns' => @elem).to_xml
|
103
97
|
request = Nokogiri::XML(request)
|
104
98
|
|
105
|
-
|
106
|
-
xsd = Nokogiri::XML::Schema(IO.read('PKIFactory.xsd'))
|
107
|
-
refute xsd.valid?(request)
|
108
|
-
end
|
99
|
+
refute_valid_against_schema 'PKIFactory.xsd', request
|
109
100
|
end
|
110
|
-
|
111
101
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class DanskeRenewCertApplicationRequestTest < ActiveSupport::TestCase
|
4
|
+
setup do
|
5
|
+
@params = danske_renew_cert_params
|
6
|
+
|
7
|
+
# Convert the keys here since the conversion is usually done by the client and these tests
|
8
|
+
# bypass the client
|
9
|
+
@params[:own_signing_certificate] = x509_certificate(@params[:own_signing_certificate])
|
10
|
+
@params[:signing_private_key] = rsa_key(@params[:signing_private_key])
|
11
|
+
|
12
|
+
@ar = Sepa::ApplicationRequest.new(@params)
|
13
|
+
@doc = @ar.to_nokogiri
|
14
|
+
end
|
15
|
+
|
16
|
+
test 'validates against schema' do
|
17
|
+
assert_valid_against_schema 'danske_pki.xsd', @doc
|
18
|
+
end
|
19
|
+
|
20
|
+
test 'signature is calculated correctly' do
|
21
|
+
sha1 = OpenSSL::Digest::SHA1.new
|
22
|
+
keys_path = File.expand_path('../keys', __FILE__)
|
23
|
+
private_key = rsa_key(File.read("#{keys_path}/signing_key.pem"))
|
24
|
+
|
25
|
+
signed_info_node = @doc.at("dsig|SignedInfo", dsig: 'http://www.w3.org/2000/09/xmldsig#')
|
26
|
+
actual_signature = encode(private_key.sign(sha1, signed_info_node.canonicalize))
|
27
|
+
|
28
|
+
calculated_signature = @doc.at("dsig|SignatureValue", dsig: 'http://www.w3.org/2000/09/xmldsig#').content
|
29
|
+
|
30
|
+
assert_equal actual_signature, calculated_signature
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class DanskeRenewCertRequestSoapBuilderTest < ActiveSupport::TestCase
|
4
|
+
setup do
|
5
|
+
@params = danske_renew_cert_params
|
6
|
+
|
7
|
+
# Convert the keys here since the conversion is usually done by the client and these tests
|
8
|
+
# bypass the client
|
9
|
+
@params[:own_signing_certificate] = x509_certificate(@params[:own_signing_certificate])
|
10
|
+
@params[:signing_private_key] = rsa_key(@params[:signing_private_key])
|
11
|
+
|
12
|
+
soap_builder = Sepa::SoapBuilder.new(@params)
|
13
|
+
@doc = Nokogiri::XML(soap_builder.to_xml)
|
14
|
+
end
|
15
|
+
|
16
|
+
test "validates against schema" do
|
17
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
18
|
+
end
|
19
|
+
|
20
|
+
test 'validates against ws security schema' do
|
21
|
+
wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
22
|
+
ws_node = @doc.at('wsse|Security', 'wsse': wsse)
|
23
|
+
ws_node = ws_node.to_xml
|
24
|
+
ws_node = Nokogiri::XML(ws_node)
|
25
|
+
|
26
|
+
assert_valid_against_schema 'oasis-200401-wss-wssecurity-secext-1.0.xsd', ws_node
|
27
|
+
end
|
28
|
+
|
29
|
+
test 'signature is calculated correctly' do
|
30
|
+
sha1 = OpenSSL::Digest::SHA1.new
|
31
|
+
private_key = rsa_key(@params.fetch(:signing_private_key))
|
32
|
+
|
33
|
+
added_signature = @doc.at("dsig|SignatureValue", dsig: 'http://www.w3.org/2000/09/xmldsig#').content
|
34
|
+
|
35
|
+
signed_info_node = @doc.at("dsig|SignedInfo", dsig: 'http://www.w3.org/2000/09/xmldsig#')
|
36
|
+
signed_info_node = signed_info_node.canonicalize(Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0)
|
37
|
+
actual_signature = encode(private_key.sign(sha1, signed_info_node)).gsub(/\s+/, "")
|
38
|
+
|
39
|
+
assert_equal actual_signature, added_signature
|
40
|
+
end
|
41
|
+
end
|
@@ -241,30 +241,18 @@ class NordeaApplicationRequestTest < ActiveSupport::TestCase
|
|
241
241
|
end
|
242
242
|
|
243
243
|
test 'download file should validate against schema' do
|
244
|
-
|
245
|
-
xsd = Nokogiri::XML::Schema(IO.read('application_request.xsd'))
|
246
|
-
assert xsd.valid?(@doc_file)
|
247
|
-
end
|
244
|
+
assert_valid_against_schema 'application_request.xsd', @doc_file
|
248
245
|
end
|
249
246
|
|
250
247
|
test 'upload file should validate against schema' do
|
251
|
-
|
252
|
-
xsd = Nokogiri::XML::Schema(IO.read('application_request.xsd'))
|
253
|
-
assert xsd.valid?(@doc_up)
|
254
|
-
end
|
248
|
+
assert_valid_against_schema 'application_request.xsd', @doc_up
|
255
249
|
end
|
256
250
|
|
257
251
|
test 'download file list should validate against schema' do
|
258
|
-
|
259
|
-
xsd = Nokogiri::XML::Schema(IO.read('application_request.xsd'))
|
260
|
-
assert xsd.valid?(@doc_list)
|
261
|
-
end
|
252
|
+
assert_valid_against_schema 'application_request.xsd', @doc_list
|
262
253
|
end
|
263
254
|
|
264
255
|
test 'get user info should validate against schema' do
|
265
|
-
|
266
|
-
xsd = Nokogiri::XML::Schema(IO.read('application_request.xsd'))
|
267
|
-
assert xsd.valid?(@doc_get)
|
268
|
-
end
|
256
|
+
assert_valid_against_schema 'application_request.xsd', @doc_get
|
269
257
|
end
|
270
258
|
end
|
@@ -64,10 +64,6 @@ class NordeaCertApplicationRequestTest < ActiveSupport::TestCase
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_should_validate_against_schema
|
67
|
-
|
68
|
-
xsd = Nokogiri::XML::Schema(IO.read('cert_application_request.xsd'))
|
69
|
-
assert xsd.valid?(@xml)
|
70
|
-
end
|
67
|
+
assert_valid_against_schema 'cert_application_request.xsd', @xml
|
71
68
|
end
|
72
|
-
|
73
69
|
end
|
@@ -56,10 +56,7 @@ class NordeaCertRequestSoapBuilderTest < ActiveSupport::TestCase
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_should_validate_against_schema
|
59
|
-
|
60
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
61
|
-
assert xsd.valid?(@xml)
|
62
|
-
end
|
59
|
+
assert_valid_against_schema 'soap.xsd', @xml
|
63
60
|
end
|
64
61
|
|
65
62
|
end
|
@@ -237,40 +237,24 @@ class NordeaGenericSoapBuilderTest < ActiveSupport::TestCase
|
|
237
237
|
end
|
238
238
|
|
239
239
|
def test_should_validate_against_schema
|
240
|
-
|
241
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
242
|
-
assert xsd.valid?(@doc)
|
243
|
-
end
|
240
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
244
241
|
end
|
245
242
|
|
246
243
|
def test_schema_validation_should_fail_with_wrong_must_understand_value
|
247
|
-
wsse
|
248
|
-
security_node = @doc.xpath(
|
249
|
-
'//wsse:Security', 'wsse' => wsse
|
250
|
-
).first
|
244
|
+
wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
245
|
+
security_node = @doc.xpath('//wsse:Security', 'wsse' => wsse).first
|
251
246
|
|
252
247
|
security_node['env:mustUnderstand'] = '3'
|
253
248
|
|
254
|
-
|
255
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
256
|
-
refute xsd.valid?(@doc)
|
257
|
-
end
|
249
|
+
refute_valid_against_schema 'soap.xsd', @doc
|
258
250
|
end
|
259
251
|
|
260
252
|
def test_should_validate_against_ws_security_schema
|
261
|
-
wsse
|
262
|
-
|
263
|
-
ws_node = @doc.xpath(
|
264
|
-
'//wsse:Security', 'wsse' => wsse
|
265
|
-
)
|
266
|
-
|
253
|
+
wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
254
|
+
ws_node = @doc.xpath('//wsse:Security', 'wsse' => wsse)
|
267
255
|
ws_node = ws_node.to_xml
|
268
256
|
ws_node = Nokogiri::XML(ws_node)
|
269
257
|
|
270
|
-
|
271
|
-
xsd = Nokogiri::XML::Schema IO.read 'oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
272
|
-
assert xsd.valid?(ws_node)
|
273
|
-
end
|
258
|
+
assert_valid_against_schema 'oasis-200401-wss-wssecurity-secext-1.0.xsd', ws_node
|
274
259
|
end
|
275
|
-
|
276
260
|
end
|
@@ -14,16 +14,7 @@ class NordeaRenewCertApplicationRequestTest < ActiveSupport::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
test "validates against schema" do
|
17
|
-
|
18
|
-
|
19
|
-
Dir.chdir(SCHEMA_PATH) do
|
20
|
-
xsd = Nokogiri::XML::Schema(IO.read('cert_application_request.xsd'))
|
21
|
-
xsd.validate(@doc).each do |error|
|
22
|
-
errors << error
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
17
|
+
assert_valid_against_schema 'cert_application_request.xsd', @doc
|
27
18
|
end
|
28
19
|
|
29
20
|
test "customer id is set correctly" do
|
@@ -14,16 +14,7 @@ class NordeaRenewCertRequestSoapBuilderTest < ActiveSupport::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
test "validates against schema" do
|
17
|
-
|
18
|
-
|
19
|
-
Dir.chdir(SCHEMA_PATH) do
|
20
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
21
|
-
xsd.validate(@doc).each do |error|
|
22
|
-
errors << error
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
17
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
27
18
|
end
|
28
19
|
|
29
20
|
test 'sender id is properly set' do
|
@@ -23,41 +23,14 @@ class OpApplicationRequestTest < ActiveSupport::TestCase
|
|
23
23
|
end
|
24
24
|
|
25
25
|
test 'download file validates against schema' do
|
26
|
-
|
27
|
-
|
28
|
-
Dir.chdir(SCHEMA_PATH) do
|
29
|
-
xsd = Nokogiri::XML::Schema(IO.read('op/ApplicationRequest_20080918.xsd'))
|
30
|
-
xsd.validate(@doc_file).each do |error|
|
31
|
-
errors << error
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
26
|
+
assert_valid_against_schema 'op/ApplicationRequest_20080918.xsd', @doc_file
|
36
27
|
end
|
37
28
|
|
38
29
|
test 'upload file validates against schema' do
|
39
|
-
|
40
|
-
|
41
|
-
Dir.chdir(SCHEMA_PATH) do
|
42
|
-
xsd = Nokogiri::XML::Schema(IO.read('op/ApplicationRequest_20080918.xsd'))
|
43
|
-
xsd.validate(@doc_up).each do |error|
|
44
|
-
errors << error
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
30
|
+
assert_valid_against_schema 'op/ApplicationRequest_20080918.xsd', @doc_up
|
49
31
|
end
|
50
32
|
|
51
33
|
test 'download file list validates against schema' do
|
52
|
-
|
53
|
-
|
54
|
-
Dir.chdir(SCHEMA_PATH) do
|
55
|
-
xsd = Nokogiri::XML::Schema(IO.read('op/ApplicationRequest_20080918.xsd'))
|
56
|
-
xsd.validate(@doc_list).each do |error|
|
57
|
-
errors << error
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
34
|
+
assert_valid_against_schema 'op/ApplicationRequest_20080918.xsd', @doc_list
|
62
35
|
end
|
63
36
|
end
|
@@ -63,15 +63,6 @@ class OpCertApplicationRequestTest < ActiveSupport::TestCase
|
|
63
63
|
end
|
64
64
|
|
65
65
|
test "validates against schema" do
|
66
|
-
|
67
|
-
|
68
|
-
Dir.chdir(SCHEMA_PATH) do
|
69
|
-
xsd = Nokogiri::XML::Schema(IO.read('op/CertApplicationRequest_200812.xsd'))
|
70
|
-
xsd.validate(@xml).each do |error|
|
71
|
-
errors << error
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
66
|
+
assert_valid_against_schema 'op/CertApplicationRequest_200812.xsd', @xml
|
76
67
|
end
|
77
68
|
end
|
@@ -48,15 +48,6 @@ class OpCertRequestSoapBuilderTest < ActiveSupport::TestCase
|
|
48
48
|
end
|
49
49
|
|
50
50
|
test "validates against schema" do
|
51
|
-
|
52
|
-
|
53
|
-
Dir.chdir(SCHEMA_PATH) do
|
54
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
55
|
-
xsd.validate(@xml).each do |error|
|
56
|
-
errors << error
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
51
|
+
assert_valid_against_schema 'soap.xsd', @xml
|
61
52
|
end
|
62
53
|
end
|
@@ -19,16 +19,7 @@ class OpGenericSoapBuilderTest < ActiveSupport::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
test 'validates against schema' do
|
22
|
-
|
23
|
-
|
24
|
-
Dir.chdir(SCHEMA_PATH) do
|
25
|
-
xsd = Nokogiri::XML::Schema(IO.read('soap.xsd'))
|
26
|
-
xsd.validate(@doc).each do |error|
|
27
|
-
errors << error
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
22
|
+
assert_valid_against_schema 'soap.xsd', @doc
|
32
23
|
end
|
33
24
|
|
34
25
|
test 'validates against ws security schema' do
|
@@ -38,15 +29,6 @@ class OpGenericSoapBuilderTest < ActiveSupport::TestCase
|
|
38
29
|
ws_node = ws_node.to_xml
|
39
30
|
ws_node = Nokogiri::XML(ws_node)
|
40
31
|
|
41
|
-
|
42
|
-
|
43
|
-
Dir.chdir(SCHEMA_PATH) do
|
44
|
-
xsd = Nokogiri::XML::Schema(IO.read('oasis-200401-wss-wssecurity-secext-1.0.xsd'))
|
45
|
-
xsd.validate(ws_node).each do |error|
|
46
|
-
errors << error
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
assert errors.empty?, "The following schema validations failed:\n#{errors.join("\n")}"
|
32
|
+
assert_valid_against_schema 'oasis-200401-wss-wssecurity-secext-1.0.xsd', ws_node
|
51
33
|
end
|
52
34
|
end
|