상세 컨텐츠

본문 제목

[Junit] assertThat, hasItems

Junit4

by kwanghyup 2020. 6. 18. 01:30

본문

import org.junit.Test;

import java.util.Arrays;

import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.MatcherAssert.assertThat;

public class SampleTest {

    @Test
    public void testAssertThatHasItems() {
        assertThat(
                Arrays.asList("Java", "Kotlin", "Scala"),
                hasItems("Java", "Kotlin"));
    }


}

관련글 더보기

댓글 영역