For the example that Brian gives, you are probably right, Jorg. But in general there needs to be a way to assert on the interaction with this service
The best way to do this would be to configure the framework to use a mock service rather than the real one. I'll try to figure out a way to do that As a fallback, you could easily write your own stub service that implements/extends MessageService. Annotate using @DomainService(menuOrder="1") so that it takes priority over the default framework implementation. HTH a bit Dan On Tue, 11 Sep 2018, 08:06 Rade, Joerg / Kuehne + Nagel / HAM GI-DP, < [email protected]> wrote: > Hi Brian, > > you try to test against a specific error message? > > I'd say this kind of test belongs to the framework. > > If you want to validate a property value have a look at [1]. > > HTH -j > [1] https://isis.apache.org/pages/tg/tg.html#_do_it > > > -----Ursprüngliche Nachricht----- > Von: Brian K [mailto:[email protected]] > Gesendet: Montag, 10. September 2018 22:33 > An: [email protected] > Betreff: BDD Testing MessageService > > If I have a Gherkin feature like: > > Given object exists > When object name is set to a number > User is notified that names can only include alpha characters > > How do I code the spec glue to check that code like the following occurs? > messageService.informUser("names can only include alpha characters"); > > Thanks! > Brian > > Kühne + Nagel (AG & Co.) KG > Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE > 812773878. > Geschäftsleitung Kühne + Nagel (AG & Co.) KG: Dr. Hansjörg Rodi (Vors. ), > Tom Ban, Martin Brinkmann, Holger Ketz, Jan-Hendrik Köstergarten, Nicholas > Minde, Lars Wedel, Matthias Weiner. > Persönlich haftende Gesellschafterin: Kühne & Nagel A.G., Rechtsform: > Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, > Geschäftsführendes Verwaltungsratsmitglied: Karl Gernandt. > Geschäftsleitung Region Zentral- und Osteuropa: Dr. Hansjörg Rodi (Vors.), > Tom Ban, Dominic Edmonds, Thierry Held, Uwe Hött, Richard Huhn, Holger > Ketz, Jan-Hendrik Köstergarten, Jan Kunze. > > Wir arbeiten ausschließlich auf Grundlage der Allgemeinen Deutschen > Spediteurbedingungen 2017 (ADSp 2017). Hinweis: Die ADSp 2017 weichen in > Ziffer 23 hinsichtlich des Haftungshöchstbetrages für Güterschäden (§ 431 > HGB) vom Gesetz ab, indem sie die Haftung bei multimodalen Transporten > unter Einschluss einer Seebeförderung und bei unbekanntem Schadenort auf 2 > SZR/kg und im Übrigen die Regelhaftung von 8,33 SZR/kg zusätzlich auf 1,25 > Millionen Euro je Schadenfall sowie 2,5 Millionen Euro je Schadenereignis, > mindestens aber 2 SZR/kg, beschränken. Die ADSp sind auf unserer Webseite > als Download erhältlich. Auf Anfrage senden wir Ihnen diese auch gerne zu. > -- DISCLAIMER: This e-mail is from Haywood Associates Ltd (Registered Number 3525455) and it and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any unauthorised use or dissemination of this communication is strictly prohibited. Any information provided to Haywood Associates Ltd shall be retained and used in accordance with our Privacy Statement at http://www.haywood-associates.co.uk/privacy. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication.
