1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.security;
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.fragment.TableFragment;
24 import org.jboss.hal.testsuite.page.configuration.ElytronMappersDecodersPage;
25 import org.jboss.hal.testsuite.test.Manatoko;
26 import org.junit.jupiter.api.BeforeAll;
27 import org.junit.jupiter.api.BeforeEach;
28 import org.junit.jupiter.api.Test;
29 import org.testcontainers.junit.jupiter.Container;
30 import org.testcontainers.junit.jupiter.Testcontainers;
31 import org.wildfly.extras.creaper.core.online.operations.Operations;
32 import org.wildfly.extras.creaper.core.online.operations.Values;
33
34 import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
35 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
36 import static org.jboss.hal.testsuite.fixtures.SecurityFixtures.EVIDENCE_DECODER_ITEM;
37 import static org.jboss.hal.testsuite.fixtures.SecurityFixtures.X500_EVIDENCE_DECODER_CREATE;
38 import static org.jboss.hal.testsuite.fixtures.SecurityFixtures.X500_EVIDENCE_DECODER_DELETE;
39 import static org.jboss.hal.testsuite.fixtures.SecurityFixtures.x500EvidenceDecoderAddress;
40
41 @Manatoko
42 @Testcontainers
43 class X500EvidenceDecoderTest {
44
45 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
46
47 @BeforeAll
48 static void setupModel() throws Exception {
49 Operations operations = new Operations(wildFly.managementClient());
50 operations.add(x500EvidenceDecoderAddress(X500_EVIDENCE_DECODER_DELETE), Values.of(NAME, X500_EVIDENCE_DECODER_DELETE));
51 }
52
53 @Inject Console console;
54 @Inject CrudOperations crud;
55 @Page ElytronMappersDecodersPage page;
56 TableFragment table;
57
58 @BeforeEach
59 void prepare() {
60 page.navigate();
61 console.verticalNavigation().selectSecondary(EVIDENCE_DECODER_ITEM,
62 "mappers-decoders-x500-subject-evidence-decoder-item");
63 table = page.getX500EvidenceDecoderTable();
64 }
65
66 @Test
67 void create() throws Exception {
68 crud.create(x500EvidenceDecoderAddress(X500_EVIDENCE_DECODER_CREATE), table,
69 form -> form.text(NAME, X500_EVIDENCE_DECODER_CREATE));
70 }
71
72 @Test
73 void delete() throws Exception {
74 crud.delete(x500EvidenceDecoderAddress(X500_EVIDENCE_DECODER_DELETE), table, X500_EVIDENCE_DECODER_DELETE);
75 }
76 }