Add StatusResultMatchers.isEqualTo Kotlin extension

Issue: SPR-16429
This commit is contained in:
Sebastien Deleuze
2018-05-15 15:31:45 +02:00
parent 2c85be333c
commit 265960f09c
3 changed files with 89 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,6 +49,7 @@ public class StatusResultMatchers {
/**
* Assert the response status code with the given Hamcrest {@link Matcher}.
* Use the {@code StatusResultMatchers.isEqualTo} extension in Kotlin.
*/
public ResultMatcher is(final Matcher<Integer> matcher) {
return result -> assertThat("Response status", result.getResponse().getStatus(), matcher);
@@ -56,6 +57,7 @@ public class StatusResultMatchers {
/**
* Assert the response status code is equal to an integer value.
* Use the {@code StatusResultMatchers.isEqualTo} extension in Kotlin.
*/
public ResultMatcher is(final int status) {
return result -> assertEquals("Response status", status, result.getResponse().getStatus());