-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: extract failing test to a QuarkusTest instead QuarkusIntegrati…
…onTest
- Loading branch information
Denis Anisimov
committed
Sep 9, 2021
1 parent
fe2d5bc
commit ff800d7
Showing
2 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...ts/common-test-code/src/test/java/com/vaadin/flow/quarkus/it/SessionContextCloseTest.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,59 @@ | ||
/* | ||
* Copyright 2000-2021 Vaadin Ltd. | ||
* | ||
* 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 com.vaadin.flow.quarkus.it; | ||
|
||
import java.io.IOException; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import com.vaadin.flow.quarkus.it.sessioncontext.SessionContextView; | ||
|
||
import static com.vaadin.flow.quarkus.it.sessioncontext.SessionContextView.SessionScopedBean.DESTROY_COUNT; | ||
|
||
/** | ||
* This should be a part of SessionContextTest but it seems someone starts Java | ||
* 8 instead of Java 11 to execute this specific test on TC so it's a | ||
* {@link QuarkusTest} instead {@link QuarkusIntegrationTest}. | ||
*/ | ||
@QuarkusTest | ||
public class SessionContextCloseTest extends AbstractCdiTest { | ||
|
||
@Override | ||
protected String getTestPath() { | ||
return "/session"; | ||
} | ||
|
||
@BeforeEach | ||
public void setUp() throws Exception { | ||
resetCounts(); | ||
open(); | ||
} | ||
|
||
@Test | ||
public void vaadinSessionCloseDestroysSessionContext() throws Exception { | ||
assertDestroyCountEquals(0); | ||
click(SessionContextView.INVALIDATEBTN_ID); | ||
assertDestroyCountEquals(1); | ||
} | ||
|
||
private void assertDestroyCountEquals(int expectedCount) | ||
throws IOException { | ||
assertCountEquals(expectedCount, DESTROY_COUNT); | ||
} | ||
} |
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