File tree 2 files changed +28
-15
lines changed
main/kotlin/no/nav/dagpenger/soap/client
test/kotlin/no/nav/dagpenger/soap/client
2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ inline fun <reified T> createSoapClient(block: Config.() -> Unit): T =
25
25
val annotations = T ::class .java.getAnnotation(WebService ::class .java)
26
26
val namespace = annotations.targetNamespace + " /Binding"
27
27
val svcName = svcName ? : annotations.name
28
- val portName = portName ? : svcName + " Port"
28
+ val portName = ( portName ? : svcName) + " Port"
29
29
30
30
JaxWsProxyFactoryBean ()
31
31
.apply {
Original file line number Diff line number Diff line change @@ -59,20 +59,33 @@ internal class SoapPortTest {
59
59
fun `kan overstyre svcName og PortName for å lage klient` () {
60
60
val stsClient = mockk<STSClient >()
61
61
62
- val e: ServiceConstructionException =
63
- assertThrows<ServiceConstructionException > {
64
- createSoapClient<YtelseskontraktV3 > {
65
- sts = stsClient
66
- stsAllowInsecure = true
67
- endpoint = " foo"
68
- wsdl = " wsdl/tjenestespesifikasjon/no/nav/tjeneste/virksomhet/ytelseskontrakt/v3/Binding.wsdl"
69
- svcName = " Blupr"
70
- portName = " Blarp"
71
- }
62
+ assertThrows<ServiceConstructionException > {
63
+ createSoapClient<YtelseskontraktV3 > {
64
+ sts = stsClient
65
+ stsAllowInsecure = true
66
+ endpoint = " foo"
67
+ wsdl = " wsdl/tjenestespesifikasjon/no/nav/tjeneste/virksomhet/ytelseskontrakt/v3/Binding.wsdl"
68
+ svcName = " Blupr"
72
69
}
73
- assertEquals(
74
- " Could not find definition for service {http://nav.no/tjeneste/virksomhet/ytelseskontrakt/v3/Binding}Blupr." ,
75
- e.message,
76
- )
70
+ }.also {
71
+ assertEquals(
72
+ " Could not find definition for service {http://nav.no/tjeneste/virksomhet/ytelseskontrakt/v3/Binding}Blupr." ,
73
+ it.message,
74
+ )
75
+ }
76
+ assertThrows<ServiceConstructionException > {
77
+ createSoapClient<YtelseskontraktV3 > {
78
+ sts = stsClient
79
+ stsAllowInsecure = true
80
+ endpoint = " foo"
81
+ wsdl = " wsdl/tjenestespesifikasjon/no/nav/tjeneste/virksomhet/ytelseskontrakt/v3/Binding.wsdl"
82
+ portName = " Blarp"
83
+ }
84
+ }.also {
85
+ assertEquals(
86
+ " Could not find definition for port {http://nav.no/tjeneste/virksomhet/ytelseskontrakt/v3/Binding}BlarpPort." ,
87
+ it.message,
88
+ )
89
+ }
77
90
}
78
91
}
You can’t perform that action at this time.
0 commit comments