@TestWithResources class InjectPropertiesResourcesTests { @GivenPropertiesResource("/com/adelean/junit/jupiter/db.properties") Properties dbProperties; @Test public void testInjectTextIntoStringInstanceField() { assertThat(dbProperties) .containsEntry("db.user", "hosuaby") .containsEntry("db.password", "password") .containsEntry("db.url", "localhost"); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter