aemo 0.5.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aemo/dispatchable.rb +2 -2
- data/lib/aemo/exceptions/invalid_nmi_allocation_type.rb +1 -1
- data/lib/aemo/exceptions/time_error.rb +20 -0
- data/lib/aemo/market/interval.rb +4 -4
- data/lib/aemo/market/node.rb +9 -3
- data/lib/aemo/market.rb +2 -4
- data/lib/aemo/msats.rb +70 -54
- data/lib/aemo/nem12/data_stream_suffix.rb +1 -1
- data/lib/aemo/nem12/quality_method.rb +25 -13
- data/lib/aemo/nem12/unit_of_measurement.rb +42 -42
- data/lib/aemo/nem12.rb +300 -94
- data/lib/aemo/nem13.rb +1 -2
- data/lib/aemo/nmi/allocation.rb +6 -7
- data/lib/aemo/nmi.rb +48 -38
- data/lib/aemo/region.rb +4 -3
- data/lib/aemo/register.rb +7 -7
- data/lib/aemo/struct.rb +3 -0
- data/lib/aemo/time.rb +112 -0
- data/lib/aemo/version.rb +1 -2
- data/lib/aemo.rb +13 -11
- data/lib/data/xml_to_json.rb +2 -4
- data/spec/aemo_spec.rb +0 -7
- data/spec/lib/aemo/market/interval_spec.rb +30 -12
- data/spec/lib/aemo/market/node_spec.rb +11 -9
- data/spec/lib/aemo/market_spec.rb +5 -4
- data/spec/lib/aemo/meter_spec.rb +2 -2
- data/spec/lib/aemo/msats_spec.rb +68 -56
- data/spec/lib/aemo/nem12_spec.rb +154 -43
- data/spec/lib/aemo/nmi/allocation_spec.rb +23 -18
- data/spec/lib/aemo/nmi_spec.rb +98 -72
- data/spec/lib/aemo/region_spec.rb +23 -18
- data/spec/spec_helper.rb +13 -13
- metadata +13 -435
data/spec/lib/aemo/nmi_spec.rb
CHANGED
@@ -10,12 +10,13 @@ describe AEMO::NMI do
|
|
10
10
|
# CLASS CONSTANTS
|
11
11
|
# ---
|
12
12
|
describe '::TNI_CODES' do
|
13
|
-
it '
|
13
|
+
it 'is a hash' do
|
14
14
|
expect(AEMO::NMI::TNI_CODES.class).to eq(Hash)
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
17
18
|
describe '::DLF_CODES' do
|
18
|
-
it '
|
19
|
+
it 'is a hash' do
|
19
20
|
expect(AEMO::NMI::DLF_CODES.class).to eq(Hash)
|
20
21
|
end
|
21
22
|
end
|
@@ -25,52 +26,57 @@ describe AEMO::NMI do
|
|
25
26
|
# ---
|
26
27
|
describe '.valid_nmi?(nmi)' do
|
27
28
|
context 'valid' do
|
28
|
-
it '
|
29
|
+
it 'validates nmi' do
|
29
30
|
json.each do |nmi|
|
30
|
-
expect(
|
31
|
+
expect(described_class.valid_nmi?(nmi['nmi'])).to be(true)
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
35
|
+
|
34
36
|
context 'invalid' do
|
35
|
-
it '
|
36
|
-
expect(
|
37
|
+
it 'invalidates' do
|
38
|
+
expect(described_class.valid_nmi?('OOOOOOOOOO')).to be(false)
|
37
39
|
end
|
38
|
-
|
39
|
-
|
40
|
+
|
41
|
+
it 'invalidates' do
|
42
|
+
expect(described_class.valid_nmi?('NM100')).to be(false)
|
40
43
|
end
|
41
|
-
|
42
|
-
|
44
|
+
|
45
|
+
it 'invalidates' do
|
46
|
+
expect { described_class.valid_nmi? }.to raise_error(ArgumentError)
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
46
50
|
|
47
51
|
describe '.valid_checksum?(nmi, checksum)' do
|
48
|
-
it '
|
52
|
+
it 'validates valid nmi and checksums' do
|
49
53
|
json.each do |nmi|
|
50
|
-
expect(
|
54
|
+
expect(described_class.valid_checksum?(nmi['nmi'], nmi['checksum'])).to be(true)
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
55
59
|
describe '.network(nmi)' do
|
56
|
-
it '
|
57
|
-
network =
|
60
|
+
it 'returns a network for an allocated NMI' do
|
61
|
+
network = described_class.network('NCCCC00000')
|
58
62
|
expect(network.title).to eq('Ausgrid')
|
59
63
|
end
|
60
|
-
|
61
|
-
|
62
|
-
|
64
|
+
|
65
|
+
it 'returns NIL for an unallocated NMI' do
|
66
|
+
network = described_class.network('ZZZZZZZZZZZZ')
|
67
|
+
expect(network).to be_nil
|
63
68
|
end
|
64
69
|
end
|
65
70
|
|
66
71
|
describe '.allocation(nmi)' do
|
67
|
-
it '
|
68
|
-
allocation =
|
72
|
+
it 'returns an Allocation for a NMI' do
|
73
|
+
allocation = described_class.allocation('NCCCC00000')
|
69
74
|
expect(allocation.title).to eq('Ausgrid')
|
70
75
|
end
|
71
|
-
|
72
|
-
|
73
|
-
|
76
|
+
|
77
|
+
it 'returns NIL for an unallocated NMI' do
|
78
|
+
allocation = described_class.allocation('ZZZZZZZZZZZZ')
|
79
|
+
expect(allocation).to be_nil
|
74
80
|
end
|
75
81
|
end
|
76
82
|
|
@@ -79,145 +85,161 @@ describe AEMO::NMI do
|
|
79
85
|
# ---
|
80
86
|
describe '#initialize' do
|
81
87
|
context 'valid' do
|
82
|
-
it '
|
83
|
-
expect(
|
88
|
+
it 'returns a valid NMI' do
|
89
|
+
expect(described_class.new('NM10000000')).to be_a(described_class)
|
84
90
|
end
|
85
|
-
|
86
|
-
|
91
|
+
|
92
|
+
it 'returns a valid NMI with MSATS' do
|
93
|
+
expect(described_class.new('NM10000000', msats_detail: {})).to be_a(described_class)
|
87
94
|
end
|
88
95
|
end
|
96
|
+
|
89
97
|
context 'invalid' do
|
90
|
-
it '
|
91
|
-
expect {
|
98
|
+
it 'raises an ArgumentError error' do
|
99
|
+
expect { described_class.new('OOOOOOOOOO') }.to raise_error(ArgumentError)
|
92
100
|
end
|
93
|
-
|
94
|
-
|
101
|
+
|
102
|
+
it 'raises an ArgumentError error' do
|
103
|
+
expect { described_class.new('NM100') }.to raise_error(ArgumentError)
|
95
104
|
end
|
96
|
-
|
97
|
-
|
105
|
+
|
106
|
+
it 'raises an ArgumentError error' do
|
107
|
+
expect { described_class.new }.to raise_error(ArgumentError)
|
98
108
|
end
|
99
109
|
end
|
100
110
|
end
|
101
111
|
|
102
112
|
describe '#valid_nmi?' do
|
103
|
-
it '
|
113
|
+
it 'validates nmi' do
|
104
114
|
json.each do |nmi|
|
105
|
-
a_nmi =
|
106
|
-
expect(a_nmi.valid_nmi?).to
|
115
|
+
a_nmi = described_class.new(nmi['nmi'])
|
116
|
+
expect(a_nmi.valid_nmi?).to be(true)
|
107
117
|
end
|
108
118
|
end
|
109
119
|
end
|
110
120
|
|
111
121
|
describe '#checksum' do
|
112
|
-
it '
|
122
|
+
it 'returns NMI checksum' do
|
113
123
|
json.each do |nmi|
|
114
|
-
a_nmi =
|
124
|
+
a_nmi = described_class.new(nmi['nmi'])
|
115
125
|
expect(a_nmi.checksum).to eq(nmi['checksum'])
|
116
126
|
end
|
117
127
|
end
|
118
128
|
end
|
119
129
|
|
120
130
|
describe '#valid_checksum?(checksum)' do
|
121
|
-
it '
|
131
|
+
it 'validates valid checksums' do
|
122
132
|
json.each do |nmi|
|
123
|
-
a_nmi =
|
124
|
-
expect(a_nmi.valid_checksum?(nmi['checksum'])).to
|
133
|
+
a_nmi = described_class.new(nmi['nmi'])
|
134
|
+
expect(a_nmi.valid_checksum?(nmi['checksum'])).to be(true)
|
125
135
|
end
|
126
136
|
end
|
127
|
-
|
137
|
+
|
138
|
+
it 'does not validate invalid checksums' do
|
128
139
|
json.each do |nmi|
|
129
|
-
a_nmi =
|
130
|
-
expect(a_nmi.valid_checksum?((1 + nmi['checksum']) % 10)).to
|
140
|
+
a_nmi = described_class.new(nmi['nmi'])
|
141
|
+
expect(a_nmi.valid_checksum?((1 + nmi['checksum']) % 10)).to be(false)
|
131
142
|
end
|
132
143
|
end
|
133
144
|
end
|
134
145
|
|
135
146
|
describe '#network' do
|
136
147
|
# Positive test cases
|
137
|
-
it '
|
148
|
+
it 'returns a network for a valid NMI' do
|
138
149
|
json.each do |nmi|
|
139
|
-
a_nmi =
|
150
|
+
a_nmi = described_class.new(nmi['nmi'])
|
140
151
|
next if a_nmi.network.nil?
|
152
|
+
|
141
153
|
expect(a_nmi.network).to be_a AEMO::NMI::Allocation
|
142
154
|
expect(a_nmi.allocation).to be_a AEMO::NMI::Allocation
|
143
155
|
end
|
144
156
|
end
|
157
|
+
|
145
158
|
# Negative test cases
|
146
|
-
it '
|
159
|
+
it 'does not return a network for a NMI not allocated to a network' do
|
147
160
|
json.each do |nmi|
|
148
|
-
a_nmi =
|
161
|
+
a_nmi = described_class.new(nmi['nmi'])
|
149
162
|
expect(a_nmi.network.class).to eq(NilClass) if a_nmi.network.nil?
|
150
163
|
end
|
151
164
|
end
|
152
165
|
end
|
153
166
|
|
154
167
|
describe '#friendly_address' do
|
155
|
-
it '
|
156
|
-
nmi =
|
168
|
+
it 'returns the empty string if the address is not a hash' do
|
169
|
+
nmi = described_class.new('4001234567')
|
157
170
|
nmi.address = 'An address'
|
158
171
|
expect(nmi.friendly_address).to eq('')
|
159
172
|
end
|
160
|
-
|
161
|
-
|
173
|
+
|
174
|
+
it 'returns a friendly address if the address is a hash' do
|
175
|
+
nmi = described_class.new('4001234567')
|
162
176
|
nmi.address = { number: '1', street: 'Bob', street_type: 'Street' }
|
163
177
|
expect(nmi.friendly_address).to eq('1, Bob, Street')
|
164
178
|
end
|
165
|
-
|
166
|
-
|
179
|
+
|
180
|
+
it 'returns a friendly address if the address is a nested hash' do
|
181
|
+
nmi = described_class.new('4001234567')
|
167
182
|
nmi.address = { house: { number: '1', suffix: 'B' }, street: 'Bob', street_type: 'Street' }
|
168
183
|
expect(nmi.friendly_address).to eq('1 B, Bob, Street')
|
169
184
|
end
|
170
185
|
end
|
171
186
|
|
172
187
|
describe '#current_daily_load' do
|
173
|
-
it '
|
174
|
-
@nmi =
|
188
|
+
it 'returns zero for no data' do
|
189
|
+
@nmi = described_class.new('4001234567')
|
175
190
|
expect(@nmi.current_daily_load).to eq(0)
|
176
191
|
end
|
177
192
|
end
|
178
193
|
|
179
194
|
describe '#current_annual_load' do
|
180
|
-
it '
|
181
|
-
@nmi =
|
195
|
+
it 'returns zero for no data' do
|
196
|
+
@nmi = described_class.new('4001234567')
|
182
197
|
expect(@nmi.current_annual_load).to eq(0)
|
183
198
|
end
|
184
199
|
end
|
185
200
|
|
186
201
|
describe '#meters_by_status' do
|
187
|
-
before
|
188
|
-
@nmi =
|
189
|
-
@nmi.meters = [
|
202
|
+
before do
|
203
|
+
@nmi = described_class.new('4001234567')
|
204
|
+
@nmi.meters = [Struct::DataStream.new(status: 'C'), Struct::DataStream.new(status: 'R')]
|
190
205
|
end
|
191
|
-
|
206
|
+
|
207
|
+
it 'returns current meters' do
|
192
208
|
expect(@nmi.meters_by_status.count).to eq(1)
|
193
209
|
end
|
194
|
-
|
210
|
+
|
211
|
+
it 'returns retired meters' do
|
195
212
|
expect(@nmi.meters_by_status('R').count).to eq(1)
|
196
213
|
end
|
197
|
-
|
214
|
+
|
215
|
+
it 'returns zero meters for weird status' do
|
198
216
|
expect(@nmi.meters_by_status('TMP').count).to eq(0)
|
199
217
|
end
|
200
218
|
end
|
201
219
|
|
202
220
|
describe 'distribution loss factors' do
|
203
|
-
before
|
204
|
-
@nmi =
|
221
|
+
before do
|
222
|
+
@nmi = described_class.new('4001234567')
|
205
223
|
@nmi.dlf = 'BL0A'
|
206
224
|
@nmi.tni = 'NGN2'
|
207
225
|
end
|
226
|
+
|
208
227
|
it 'has a valid DLF Code' do
|
209
228
|
expect(@nmi.dlf).to eq('BL0A')
|
210
229
|
end
|
230
|
+
|
211
231
|
it 'has a DLF value' do
|
212
232
|
Timecop.freeze('2016-06-01T00:00:00+1000') do
|
213
233
|
expect(@nmi.dlfc_value.class).to eq(Float)
|
214
234
|
end
|
215
235
|
end
|
236
|
+
|
216
237
|
it 'has DLF values' do
|
217
238
|
Timecop.freeze('2016-06-01T00:00:00+1000') do
|
218
239
|
expect(@nmi.dlfc_values.class).to eq(Array)
|
219
240
|
end
|
220
241
|
end
|
242
|
+
|
221
243
|
it 'has historical values for DLF values' do
|
222
244
|
valid_dlfc_values = [
|
223
245
|
{ datetime: '2003-06-01T00:00:00+1000', value: 1.0713 },
|
@@ -247,8 +269,8 @@ describe AEMO::NMI do
|
|
247
269
|
end
|
248
270
|
|
249
271
|
describe 'transmission node identifiers and loss factors' do
|
250
|
-
before
|
251
|
-
@nmi =
|
272
|
+
before do
|
273
|
+
@nmi = described_class.new('4001234567')
|
252
274
|
@nmi.dlf = 'BL0A'
|
253
275
|
@nmi.tni = 'NGN2'
|
254
276
|
end
|
@@ -256,16 +278,19 @@ describe AEMO::NMI do
|
|
256
278
|
it 'has a valid TNI Code' do
|
257
279
|
expect(@nmi.tni).to eq('NGN2')
|
258
280
|
end
|
281
|
+
|
259
282
|
it 'has a TNI value' do
|
260
283
|
Timecop.freeze('2016-06-01T00:00:00+1000') do
|
261
284
|
expect(@nmi.tni_value(Time.now).class).to eq(Float)
|
262
285
|
end
|
263
286
|
end
|
287
|
+
|
264
288
|
it 'has TNI values' do
|
265
289
|
Timecop.freeze('2016-06-01T00:00:00+1000') do
|
266
290
|
expect(@nmi.tni_values.class).to eq(Array)
|
267
291
|
end
|
268
292
|
end
|
293
|
+
|
269
294
|
it 'has historical values for TNI values' do
|
270
295
|
valid_tni_values = [
|
271
296
|
{ datetime: '2014-06-01T00:00:00+1000', value: 1.0383 },
|
@@ -284,15 +309,16 @@ describe AEMO::NMI do
|
|
284
309
|
end
|
285
310
|
|
286
311
|
describe 'MSATS functions' do
|
287
|
-
it '
|
312
|
+
it 'gets data' do
|
288
313
|
AEMO::MSATS.authorize('ER', 'ER', 'ER')
|
289
|
-
nmi =
|
314
|
+
nmi = described_class.new('4001234567')
|
290
315
|
nmi.update_from_msats!
|
291
|
-
expect(nmi.msats_detail).
|
316
|
+
expect(nmi.msats_detail).not_to be_nil
|
292
317
|
end
|
293
|
-
|
318
|
+
|
319
|
+
it 'returns the hash of raw data' do
|
294
320
|
AEMO::MSATS.authorize('ER', 'ER', 'ER')
|
295
|
-
nmi =
|
321
|
+
nmi = described_class.new('4001234567')
|
296
322
|
expect(nmi.raw_msats_nmi_detail.class).to eq(Hash)
|
297
323
|
end
|
298
324
|
end
|
@@ -4,55 +4,60 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe AEMO::Region do
|
6
6
|
describe '.REGIONS' do
|
7
|
-
it '
|
7
|
+
it 'is a hash' do
|
8
8
|
expect(AEMO::Region::REGIONS).to be_instance_of(Hash)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'creating a region' do
|
13
|
-
it '
|
14
|
-
expect {
|
13
|
+
it 'raises an error if invalid region' do
|
14
|
+
expect { described_class.new('BOTTOMS') }.to raise_error(ArgumentError)
|
15
15
|
end
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
it 'creates if region valid' do
|
18
|
+
expect { described_class.new('NSW') }.not_to raise_error
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
21
22
|
describe 'AEMO::Region instance methods' do
|
22
|
-
before
|
23
|
-
@nsw =
|
23
|
+
before do
|
24
|
+
@nsw = described_class.new('NSW')
|
24
25
|
end
|
25
|
-
|
26
|
+
|
27
|
+
it 'has an abbreviation' do
|
26
28
|
expect(@nsw.abbr).to eq('NSW')
|
27
29
|
end
|
28
|
-
|
30
|
+
|
31
|
+
it 'has a fullname' do
|
29
32
|
expect(@nsw.fullname).to eq('New South Wales')
|
30
33
|
end
|
31
|
-
|
34
|
+
|
35
|
+
it 'has to_s method' do
|
32
36
|
expect(@nsw.to_s).to eq('NSW')
|
33
37
|
end
|
34
38
|
|
35
|
-
it '
|
36
|
-
expect(@nsw.send(:valid_region?, 'NSW')).to
|
39
|
+
it 'has a valid region' do
|
40
|
+
expect(@nsw.send(:valid_region?, 'NSW')).to be(true)
|
37
41
|
end
|
38
42
|
|
39
|
-
it '
|
40
|
-
expect(@nsw.send(:valid_region?, 'BOB')).to
|
43
|
+
it 'has return invalid for invalid region' do
|
44
|
+
expect(@nsw.send(:valid_region?, 'BOB')).to be(false)
|
41
45
|
end
|
42
46
|
|
43
47
|
describe 'AEMO::Region dispatch information' do
|
44
|
-
it '
|
48
|
+
it 'returns current dispatch data' do
|
45
49
|
expect(@nsw.current_dispatch.count).to eq(AEMO::Market.current_dispatch(@nsw.abbr).count)
|
46
50
|
end
|
47
|
-
|
51
|
+
|
52
|
+
it 'returns current trading data' do
|
48
53
|
expect(@nsw.current_trading.count).to eq(AEMO::Market.current_trading(@nsw.abbr).count)
|
49
54
|
end
|
50
55
|
end
|
51
56
|
end
|
52
57
|
|
53
58
|
describe 'AEMO::Region class methods' do
|
54
|
-
it '
|
55
|
-
expect(
|
59
|
+
it 'returns all regions' do
|
60
|
+
expect(described_class.all.count).to eq(AEMO::Region::REGIONS.keys.count)
|
56
61
|
end
|
57
62
|
end
|
58
63
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -18,7 +18,7 @@ require 'aemo'
|
|
18
18
|
|
19
19
|
RSpec.configure do |config|
|
20
20
|
# WebMock
|
21
|
-
config.before
|
21
|
+
config.before do
|
22
22
|
csv_headers = { 'Content-Type' => 'text/csv' }
|
23
23
|
xml_headers = { 'Content-Type' => 'text/xml' }
|
24
24
|
|
@@ -45,43 +45,43 @@ RSpec.configure do |config|
|
|
45
45
|
.to_return(status: 200, body: File.new('spec/fixtures/Market/DATA201502_NSW1.csv'), headers: csv_headers)
|
46
46
|
|
47
47
|
# MSATS
|
48
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
48
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/C4/ER})
|
49
49
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
50
50
|
.to_return(status: 200, body: File.new('spec/fixtures/MSATS/c4.xml'), headers: xml_headers)
|
51
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
51
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/MSATSLimits/ER})
|
52
52
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
53
53
|
.to_return(status: 200, body: File.new('spec/fixtures/MSATS/msats_limits.xml'), headers: xml_headers)
|
54
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
54
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/NMIDetail/ER})
|
55
55
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
56
56
|
.to_return(status: 200, body: File.new('spec/fixtures/MSATS/nmi_details.xml'), headers: xml_headers)
|
57
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
57
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/NMIDiscovery/ER})
|
58
58
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
59
59
|
.to_return(status: 200, body: File.new('spec/fixtures/MSATS/nmi_discovery_by_address.xml'), headers: xml_headers)
|
60
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
60
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/ParticipantSystemStatus/ER})
|
61
61
|
.with(headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml' })
|
62
62
|
.to_return(status: 200, body: File.new('spec/fixtures/MSATS/participant_system_status.xml'), headers: xml_headers)
|
63
63
|
# MSATS ERRORS
|
64
64
|
# Invalid MSATS User
|
65
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
65
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/C4/NOTER})
|
66
66
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
67
67
|
.to_return(status: 404, body: '', headers: xml_headers)
|
68
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
68
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/MSATSLimits/NOTER})
|
69
69
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
70
70
|
.to_return(status: 404, body: '', headers: xml_headers)
|
71
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
71
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/NMIDetail/NOTER})
|
72
72
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
73
73
|
.to_return(status: 404, body: '', headers: xml_headers)
|
74
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
74
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/NMIDiscovery/NOTER})
|
75
75
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
76
76
|
.to_return(status: 404, body: '', headers: xml_headers)
|
77
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
77
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/ParticipantSystemStatus/NOTER})
|
78
78
|
.with(headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml' })
|
79
79
|
.to_return(status: 404, body: '', headers: xml_headers)
|
80
80
|
# Data errors
|
81
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
81
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/C4/ER\?.+?NMI=4001234566.+?})
|
82
82
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
83
83
|
.to_return(status: 404, body: '', headers: xml_headers)
|
84
|
-
stub_request(:get, %r{msats.prod.nemnet.net.au
|
84
|
+
stub_request(:get, %r{msats.prod.nemnet.net.au/msats/ws/NMIDetail/ER\?.+?nmi=4001234566.+?})
|
85
85
|
.with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
|
86
86
|
.to_return(status: 404, body: '', headers: xml_headers)
|
87
87
|
end
|