Skip to content

Commit f266c3c

Browse files
Version 5.0.0
1 parent f471891 commit f266c3c

35 files changed

+1023
-102
lines changed

Brewfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
brew 'mint'
1+
brew 'mint'
2+
brew 'maven'

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
github "Quick/Nimble" ~> 9.0
2-
github "tadija/AEXML" "4.5.0"
2+
github "tadija/AEXML" ~> 4.0
33
github "hectr/swift-stream-reader" "0.3.0"
44
github "swiftsocket/SwiftSocket" "2e6ba27140a29fae8a6331ba4463312e0c71a6b0"

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ github "SwiftCommon/DataKit" "1.1.0"
55
github "gematik/OpenSSL-Swift" "3.0.3"
66
github "hectr/swift-stream-reader" "0.3.0"
77
github "swiftsocket/SwiftSocket" "2e6ba27140a29fae8a6331ba4463312e0c71a6b0"
8-
github "tadija/AEXML" "4.5.0"
8+
github "tadija/AEXML" "4.6.1"

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,4 @@ RUBY VERSION
308308
ruby 2.6.5p114
309309

310310
BUNDLED WITH
311-
2.3.16
311+
2.3.20

IntegrationTests/CardSimulationTerminalTestCase/CardSimulationTerminalTestCase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ open class CardSimulationTerminalTestCase: XCTestCase {
7070
let manipulators = [cardImagePath, channelContextPath]
7171
return CardSimulationTerminalResource(url: config,
7272
configManipulators: manipulators,
73-
simulatorVersion: "2.7.9-395")
73+
simulatorVersion: "2.8.4-436")
7474
}
7575
#endif
7676

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//
2+
// Copyright (c) 2022 gematik GmbH
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the License);
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an 'AS IS' BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
import HealthCardAccess
19+
@testable import HealthCardControl
20+
import Nimble
21+
import XCTest
22+
23+
final class HealthCardTypeExtChangeReferenceDataIntegrationTest: CardSimulationTerminalTestCase {
24+
override class var configFileInput: String {
25+
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml"
26+
}
27+
28+
override class var healthCardStatusInput: HealthCardStatus { .valid(cardType: .egk(generation: .g2_1)) }
29+
30+
func testChangeReferenceDataEgk21_success() throws {
31+
let old = "123456" as Format2Pin
32+
let new = "654321" as Format2Pin
33+
34+
expect(
35+
try Self.healthCard.changeReferenceDataSetNewPin(
36+
old: old,
37+
new: new
38+
)
39+
.test()
40+
) == ChangeReferenceDataResponse.success
41+
}
42+
43+
func testChangeReferenceDataEgk21_wrongPasswordLength() throws {
44+
let old = "123456" as Format2Pin
45+
let new = "654321123456" as Format2Pin
46+
47+
expect(
48+
try Self.healthCard.changeReferenceDataSetNewPin(
49+
old: old,
50+
new: new,
51+
type: EgkFileSystem.Pin.mrpinHome,
52+
dfSpecific: false
53+
)
54+
.test()
55+
) == ChangeReferenceDataResponse.wrongPasswordLength
56+
}
57+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//
2+
// Copyright (c) 2022 gematik GmbH
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the License);
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an 'AS IS' BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
import HealthCardAccess
19+
@testable import HealthCardControl
20+
import Nimble
21+
import XCTest
22+
23+
// Note: This continuation of `HealthCardTypeExtChangeReferenceDataIntegrationTest` exists to separate
24+
// the count dependent tests from the other ones.
25+
final class HealthCardTypeExtChangeReferenceDataIntegrationTestCont: CardSimulationTerminalTestCase {
26+
override class var configFileInput: String {
27+
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml"
28+
}
29+
30+
override class var healthCardStatusInput: HealthCardStatus {
31+
.valid(cardType: .egk(generation: .g2_1))
32+
}
33+
34+
func testChangeReferenceDataEgk21_wrongSecretWarning() throws {
35+
let wrongOld = "9999999" as Format2Pin
36+
let correctOld = "123456" as Format2Pin
37+
let new = "654321" as Format2Pin
38+
39+
expect(
40+
try Self.healthCard.changeReferenceDataSetNewPin(
41+
old: wrongOld,
42+
new: new,
43+
type: EgkFileSystem.Pin.mrpinHome,
44+
dfSpecific: false
45+
)
46+
.test()
47+
) == ChangeReferenceDataResponse.wrongSecretWarning(retryCount: 2)
48+
49+
expect(
50+
try Self.healthCard.changeReferenceDataSetNewPin(
51+
old: wrongOld,
52+
new: new,
53+
type: EgkFileSystem.Pin.mrpinHome,
54+
dfSpecific: false
55+
)
56+
.test()
57+
) == ChangeReferenceDataResponse.wrongSecretWarning(retryCount: 1)
58+
59+
expect(
60+
try Self.healthCard.changeReferenceDataSetNewPin(
61+
old: correctOld,
62+
new: new,
63+
type: EgkFileSystem.Pin.mrpinHome,
64+
dfSpecific: false
65+
)
66+
.test()
67+
) == ChangeReferenceDataResponse.success
68+
}
69+
}

IntegrationTests/HealthCardControl/HealthCardTypeExtVerifyPinTest.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ final class HealthCardTypeExtVerifyPinTest: CardSimulationTerminalTestCase {
3636
} == VerifyPinResponse.success
3737
}
3838

39-
func testVerifyMrPinHomeEgk21Failing() {
39+
func testVerifyMrPinHomeEgk21_WarningRetryCounter() {
4040
let pinCode = "654321"
4141
expect {
4242
let format2Pin = try Format2Pin(pincode: pinCode)
4343
return try Self.healthCard.verify(pin: format2Pin, type: EgkFileSystem.Pin.mrpinHome)
4444
.test()
45-
} == VerifyPinResponse.failed(retryCount: 2)
45+
} == VerifyPinResponse.wrongSecretWarning(retryCount: 2)
4646
}
4747

4848
static let allTests = [
4949
("testVerifyMrPinHomeEgk21", testVerifyMrPinHomeEgk21),
50-
("testVerifyMrPinHomeEgk21Failing", testVerifyMrPinHomeEgk21Failing),
50+
("testVerifyMrPinHomeEgk21Failing", testVerifyMrPinHomeEgk21_WarningRetryCounter),
5151
]
5252
}

0 commit comments

Comments
 (0)