Zum Inhalt springen

Christians BLOG

Cut and Paste ersetzt kein Denken.

  • Datenschutzerklärung
  • Impressum

Kategorie: Java

5. November 2020 christian

Test private methods

Sometimes a method you want to test is private and cannot be called directly from a junit test. Of course

Weiterlesen
3. April 2020 christian

Simple test with Spring services and mocks

This is a sample how to use mocks in a junit test class:

Weiterlesen
27. Juni 2019 christian

Mocking a Spring service with Mockito for a JUnit test

First define the bean to be mocked in your XML like this Then you can inject it into other beans

Weiterlesen
4. April 2019 christian

Logging SQL-Statements with IBatis on Wildfly

Depending on what you want to see, you can enable logging for iBATIS in your logging configuration like this: iBATIS

Weiterlesen
21. Januar 2019 christian

Capture arguments from a mocked service call

If you like to get the arguments of a mocked service call SERVICEMETHOD you can use this Now you can

Weiterlesen
7. Januar 2019 christian

Define Spring Beans inline JUnit test

Sometimes you like to define some Spring beans in a JUnit test and do not want to create extra files

Weiterlesen
10. Dezember 2018 christian

Reset Mocks before every test

Some mocks may need a reset before the test is run. Especially if the same one is used in several

Weiterlesen
21. November 2018 christian

Parse double from string with dot or comma

Sometimes it is not clear which decimal seperator is used. You can have a dot or a comma without knowing

Weiterlesen
12. November 2018 christian

Create BigDecimal from double

If you create a BigDecimal from a double value you should not use the contructor of BigDecimal: Because of the

Weiterlesen

Neueste Beiträge

  • Arduino mit KNX verbinden
  • Ultraschallsensor HC-SR04 am Calliope Mini
  • Wetterstation ELV WS980WiFi
  • Motorsteuerung Calliope Mini für LEGO 9V-Motoren
  • Test private methods

Neueste Kommentare

    Archive

    • Januar 2024
    • Februar 2022
    • Juli 2021
    • November 2020
    • April 2020
    • Juni 2019
    • April 2019
    • Januar 2019
    • Dezember 2018
    • November 2018

    Kategorien

    • Allgemein
    • Java
    • Projekte

    Meta

    • Anmelden
    • Feed der Einträge
    • Kommentar-Feed
    • WordPress.org
    WordPress Theme: Wellington by ThemeZee.