View Javadoc
1   /*
2    *  Copyright 2022 Red Hat
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      https://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  package org.jboss.hal.testsuite.test.configuration.jpa;
17  
18  import org.jboss.arquillian.core.api.annotation.Inject;
19  import org.jboss.arquillian.graphene.page.Page;
20  import org.jboss.hal.testsuite.CrudOperations;
21  import org.jboss.hal.testsuite.container.WildFlyContainer;
22  import org.jboss.hal.testsuite.fragment.FormFragment;
23  import org.jboss.hal.testsuite.page.configuration.JpaPage;
24  import org.jboss.hal.testsuite.test.Manatoko;
25  import org.junit.jupiter.api.BeforeEach;
26  import org.junit.jupiter.api.Test;
27  import org.testcontainers.junit.jupiter.Container;
28  import org.testcontainers.junit.jupiter.Testcontainers;
29  
30  import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
31  import static org.jboss.hal.testsuite.fixtures.JpaFixtures.DEFAULT_EXTENDED_PERSISTENCE_INHERITANCE;
32  import static org.jboss.hal.testsuite.fixtures.JpaFixtures.SHALLOW;
33  import static org.jboss.hal.testsuite.fixtures.JpaFixtures.SUBSYSTEM_ADDRESS;
34  
35  @Manatoko
36  @Testcontainers
37  class JpaTest {
38  
39      @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
40  
41      @Inject CrudOperations crud;
42      @Page JpaPage page;
43      FormFragment form;
44  
45      @BeforeEach
46      void setUp() {
47          page.navigate();
48          form = page.getForm();
49      }
50  
51      @Test
52      void update() throws Exception {
53          crud.update(SUBSYSTEM_ADDRESS, form,
54                  f -> f.select(DEFAULT_EXTENDED_PERSISTENCE_INHERITANCE, SHALLOW),
55                  resourceVerifier -> resourceVerifier.verifyAttribute(DEFAULT_EXTENDED_PERSISTENCE_INHERITANCE,
56                          SHALLOW));
57      }
58  
59      @Test
60      void reset() throws Exception {
61          crud.reset(SUBSYSTEM_ADDRESS, form);
62      }
63  }