0 points

Load binary with JUnit 5 extension


dashboard

Thu Aug 27 2020 11:16:41 GMT+0000 (UTC)

Posted by @hosuaby #java

@TestWithResources
class InjectBinaryResourcesTests {

    @GivenBinaryResource("/com/adelean/junit/jupiter/fibonacci.bin")
    byte[] fibonacci;

    @Test
    public void testInjectBinaryContentIntoByteArrayInstanceField() {
        assertThat(fibonacci)
                .contains(1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89);
    }
}
content_copy Copy