@Test public void getRequestHttpMethod_returns_null_when_passed_null() { // expect assertThat(implSpy.getRequestHttpMethod(null)).isNull(); }
@DataProvider(value = { "GET | GET", "HEAD | HEAD", "POST | POST", "PUT | PUT", "PATCH | PATCH", "DELETE | DELETE", "OPTIONS | OPTIONS", "TRACE | TRACE", "null | UNKNOWN_HTTP_METHOD" }, splitBy = "\\|") @Test public void getRequestHttpMethod_works_as_expected(HttpMethod httpMethod, String expectedResult) { // given doReturn(httpMethod).when(requestMock).getMethod(); // when String result = implSpy.getRequestHttpMethod(requestMock); // then assertThat(result).isEqualTo(expectedResult); }