-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restore previous constructor as deprecated
- Loading branch information
Showing
4 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/test/java/io/gravitee/gateway/reactive/api/el/EvaluableRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.gateway.reactive.api.el; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
|
||
import io.gravitee.gateway.reactive.api.context.GenericRequest; | ||
import io.gravitee.gateway.reactive.api.context.http.HttpBaseRequest; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.Mockito; | ||
|
||
/** | ||
* @author Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
class EvaluableRequestTest { | ||
|
||
@Test | ||
void should_construct_with_http_base_request() { | ||
HttpBaseRequest httpBaseRequest = Mockito.mock(HttpBaseRequest.class); | ||
assertDoesNotThrow(() -> new EvaluableRequest(httpBaseRequest)); | ||
} | ||
|
||
@Test | ||
void should_construct_with_http_base_request_and_content() { | ||
HttpBaseRequest httpBaseRequest = Mockito.mock(HttpBaseRequest.class); | ||
assertDoesNotThrow(() -> new EvaluableRequest(httpBaseRequest, "content")); | ||
} | ||
|
||
@Test | ||
void should_construct_with_generic_request() { | ||
GenericRequest genericRequest = Mockito.mock(GenericRequest.class); | ||
assertDoesNotThrow(() -> new EvaluableRequest(genericRequest)); | ||
} | ||
|
||
@Test | ||
void should_construct_with_generic_request_and_content() { | ||
GenericRequest genericRequest = Mockito.mock(GenericRequest.class); | ||
assertDoesNotThrow(() -> new EvaluableRequest(genericRequest, "content")); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/test/java/io/gravitee/gateway/reactive/api/el/EvaluableResponseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.gateway.reactive.api.el; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
|
||
import io.gravitee.gateway.reactive.api.context.GenericResponse; | ||
import io.gravitee.gateway.reactive.api.context.http.HttpBaseResponse; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.Mockito; | ||
|
||
/** | ||
* @author Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
class EvaluableResponseTest { | ||
|
||
@Test | ||
void should_construct_with_http_base_response() { | ||
HttpBaseResponse httpBaseResponse = Mockito.mock(HttpBaseResponse.class); | ||
assertDoesNotThrow(() -> new EvaluableResponse(httpBaseResponse)); | ||
} | ||
|
||
@Test | ||
void should_construct_with_http_base_response_and_content() { | ||
HttpBaseResponse httpBaseResponse = Mockito.mock(HttpBaseResponse.class); | ||
assertDoesNotThrow(() -> new EvaluableResponse(httpBaseResponse, "content")); | ||
} | ||
|
||
@Test | ||
void should_construct_with_generic_response() { | ||
GenericResponse genericResponse = Mockito.mock(GenericResponse.class); | ||
assertDoesNotThrow(() -> new EvaluableResponse(genericResponse)); | ||
} | ||
|
||
@Test | ||
void should_construct_with_generic_response_and_content() { | ||
GenericResponse genericResponse = Mockito.mock(GenericResponse.class); | ||
assertDoesNotThrow(() -> new EvaluableResponse(genericResponse, "content")); | ||
} | ||
} |