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.logging.subsystem;
17  
18  import org.jboss.arquillian.core.api.annotation.Inject;
19  import org.jboss.arquillian.graphene.page.Page;
20  import org.jboss.hal.testsuite.Console;
21  import org.jboss.hal.testsuite.CrudOperations;
22  import org.jboss.hal.testsuite.container.WildFlyContainer;
23  import org.jboss.hal.testsuite.page.configuration.LoggingSubsystemConfigurationPage;
24  import org.jboss.hal.testsuite.test.Manatoko;
25  import org.junit.jupiter.api.Test;
26  import org.testcontainers.junit.jupiter.Container;
27  import org.testcontainers.junit.jupiter.Testcontainers;
28  
29  import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
30  import static org.jboss.hal.testsuite.fixtures.LoggingFixtures.ADD_LOGGING_API_DEPENDENCIES;
31  import static org.jboss.hal.testsuite.fixtures.LoggingFixtures.SUBSYSTEM_ADDRESS;
32  
33  @Manatoko
34  @Testcontainers
35  class ConfigurationTest {
36  
37      @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
38  
39      @Inject Console console;
40      @Inject CrudOperations crud;
41      @Page LoggingSubsystemConfigurationPage page;
42  
43      @Test
44      public void updateConfiguration() throws Exception {
45          page.navigate();
46          console.verticalNavigation().selectPrimary("logging-config-item");
47          crud.update(SUBSYSTEM_ADDRESS, page.getConfigurationForm(), ADD_LOGGING_API_DEPENDENCIES, false);
48      }
49  
50      @Test
51      public void resetConfiguration() throws Exception {
52          page.navigate();
53          console.verticalNavigation().selectPrimary("logging-config-item");
54          crud.reset(SUBSYSTEM_ADDRESS, page.getConfigurationForm());
55      }
56  }