Skip to content

Commit c5271d7

Browse files
Feature/service now module initial setup (#77)
* added service now api integration * Add Service Now functions and Service Now Getting Started * Add Service Now functions and Service Now Getting Started * Add ServiceNow functions and ServiceNow Getting Started * Add ServiceNow functions and ServiceNow Getting Started * Refactoring based on the comments * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow * refactoring bellatrix.servicenow update getting-started\bellatrix.servicenow --------- Co-authored-by: veselinov.viktor <[email protected]> Co-authored-by: EliNedyalkova <dAtp23M24@>
1 parent dd9ef3b commit c5271d7

File tree

211 files changed

+11428
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+11428
-3
lines changed

bellatrix.data/src/main/java/solutions/bellatrix/data/http/infrastructure/HttpRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public abstract class HttpRepository<THttpEntity extends HttpEntity> implements
3030
protected final HttpContext repositoryContext;
3131
private final Class<THttpEntity> entityType;
3232
private final ObjectConverter objectConverter;
33-
private HttpContext requestContext;
33+
protected HttpContext requestContext;
3434

3535
protected HttpRepository(Class<THttpEntity> entityType, ObjectConverter objectConverter, Supplier<HttpContext> repositoryContext) {
3636
this.entityType = entityType;
@@ -158,7 +158,7 @@ private RequestSpecification client() {
158158
return RestAssured.given().spec(requestContext.requestSpecification());
159159
}
160160

161-
private <R> R deserializeInternal(HttpResponse response, DeserializationMode mode) {
161+
protected <R> R deserializeInternal(HttpResponse response, DeserializationMode mode) {
162162
try {
163163
if (mode == DeserializationMode.LIST) {
164164
List<THttpEntity> entities = objectConverter.fromStringToList(response.getBody(), entityType);
@@ -174,7 +174,7 @@ private <R> R deserializeInternal(HttpResponse response, DeserializationMode mod
174174
}
175175
}
176176

177-
private Response broadcastRequest(Supplier<Response> responseSupplier) {
177+
protected Response broadcastRequest(Supplier<Response> responseSupplier) {
178178
try {
179179
SENDING_REQUEST.broadcast(new HttpRequestEventArgs(requestContext));
180180
Response response = responseSupplier.get();

bellatrix.servicenow/pom.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>solutions.bellatrix</groupId>
8+
<artifactId>bellatrix</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>bellatrix.servicenow</artifactId>
13+
14+
<properties>
15+
<maven.compiler.source>19</maven.compiler.source>
16+
<maven.compiler.target>19</maven.compiler.target>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
<bellatrix.framework.version>1.0</bellatrix.framework.version>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.junit.jupiter</groupId>
24+
<artifactId>junit-jupiter</artifactId>
25+
<version>RELEASE</version>
26+
<scope>test</scope>
27+
</dependency>
28+
<dependency>
29+
<groupId>solutions.bellatrix</groupId>
30+
<artifactId>bellatrix.core</artifactId>
31+
<version>1.0</version>
32+
<scope>compile</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>solutions.bellatrix</groupId>
36+
<artifactId>bellatrix.web</artifactId>
37+
<version>1.0</version>
38+
<scope>compile</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>solutions.bellatrix</groupId>
42+
<artifactId>bellatrix.api</artifactId>
43+
<version>${bellatrix.framework.version}</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.github.javafaker</groupId>
47+
<artifactId>javafaker</artifactId>
48+
<version>1.0.2</version>
49+
<scope>compile</scope>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>solutions.bellatrix</groupId>
54+
<artifactId>bellatrix.data</artifactId>
55+
<version>1.0-SNAPSHOT</version>
56+
</dependency>
57+
</dependencies>
58+
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package solutions.bellatrix.servicenow.baseTest;
2+
3+
4+
import solutions.bellatrix.servicenow.listeners.AutoWaitListener;
5+
import solutions.bellatrix.servicenow.pages.serviceNowPage.ServiceNowPage;
6+
import solutions.bellatrix.servicenow.pages.serviceNowTableViewPage.ServiceNowTableViewPage;
7+
import solutions.bellatrix.servicenow.plugins.authentication.AuthenticationPlugin;
8+
import solutions.bellatrix.servicenow.plugins.fileuploads.FileUploadPlugin;
9+
import solutions.bellatrix.core.plugins.junit.BaseTest;
10+
import solutions.bellatrix.web.infrastructure.BrowserLifecyclePlugin;
11+
import solutions.bellatrix.web.infrastructure.LogLifecyclePlugin;
12+
import solutions.bellatrix.web.services.App;
13+
14+
public class ServiceNowBaseTest extends BaseTest {
15+
protected ServiceNowPage serviceNowPage;
16+
protected ServiceNowTableViewPage serviceNowTableViewPage;
17+
18+
protected App app() {
19+
return new App();
20+
}
21+
22+
@Override
23+
protected void configure() {
24+
addPlugin(FileUploadPlugin.class);
25+
addPlugin(LogLifecyclePlugin.class);
26+
addPlugin(BrowserLifecyclePlugin.class);
27+
addPlugin(AuthenticationPlugin.class);
28+
addListener(AutoWaitListener.class);
29+
}
30+
31+
@Override
32+
protected void beforeEach() throws Exception {
33+
super.beforeEach();
34+
serviceNowPage = app().createPage(ServiceNowPage.class);
35+
serviceNowTableViewPage = app().createPage(ServiceNowTableViewPage.class);
36+
}
37+
38+
@Override
39+
protected void afterEach() {
40+
super.afterEach();
41+
}
42+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package solutions.bellatrix.servicenow.components.enums;
2+
3+
public enum InputRole {
4+
COMBOBOX("combobox"),
5+
SPINBUTTON("spinbutton"),
6+
TEXTBOX("textbox");
7+
8+
private final String role;
9+
10+
InputRole(String role) {
11+
this.role = role;
12+
}
13+
14+
public String getRole() {
15+
return role;
16+
}
17+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package solutions.bellatrix.servicenow.components.enums;
2+
3+
public enum OperationsAttributes {
4+
EQUALS("Equals", "=", "Equals"),
5+
DOES_NOT_EQUAL("Does not equal", "!=", "DoesNotEqual"),
6+
IS_LESS_THAN("Is less than", "<", "IsLessThan"),
7+
IS_GREATER_THAN("Is greater than", ">", "IsGreaterThan"),
8+
IS_LESS_THAN_OR_EQUAL_TO("Is less than or equal to", "<=", "IsLessThanOrEqualTo"),
9+
IS_GREATER_THAN_OR_EQUAL_TO("Is greater than or equal to", ">=", "IsGreaterThanOrEqualTo"),
10+
IS_BLANK("Is blank", "", "IsBlank"),
11+
IS_NOT_BLANK("Is not blank", "", "IsNotBlank"),
12+
IS_BETWEEN("Is between", "", "IsBetween"),
13+
CONTAINS("Contains", "", "Contains"),
14+
DOES_NOT_CONTAIN("Does not contain", "", "DoesNotContain"),
15+
STARTS_WITH("Starts with", "", "StartsWith"),
16+
ENDS_WITH("Ends with", "", "EndsWith");
17+
18+
private final String value;
19+
private final String sign;
20+
private final String nameMethod;
21+
22+
OperationsAttributes(String value, String sign, String nameMethod) {
23+
this.value = value;
24+
this.sign = sign;
25+
this.nameMethod = nameMethod;
26+
}
27+
28+
public String getValue() {
29+
return this.value;
30+
}
31+
32+
public String getSign() {
33+
return sign;
34+
}
35+
36+
public String getNameMethod() {
37+
return nameMethod;
38+
}
39+
40+
@Override
41+
public String toString() {
42+
return this.value;
43+
}
44+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package solutions.bellatrix.servicenow.components.enums;
2+
3+
public enum SnComponentType {
4+
CHOICE("choice"),
5+
DATE("date"),
6+
DATE_TIME("date_time"),
7+
DOCUMENT_ID("document_id"),
8+
REFERENCE("reference"),
9+
STRING("string"),
10+
TABLE_NAME("table_name"),
11+
PICK_LIST("pick_list"),
12+
BOOLEAN("boolean"),
13+
FLOAT("float"),
14+
INTEGER("integer"),
15+
PERCENT_COMPLETE("percent_complete"),
16+
CURRENCY_2("currency2"),
17+
GLIDE_LIST("glide_list"),
18+
GLIDE_TIME("glide_time"),
19+
DURATION("glide_duration"),
20+
HTML("html"),
21+
CURRENCY("currency2"),
22+
JOURNAL_INPUT("journal_input"),
23+
CURRENCY2("currency2"),
24+
FIELD_NAME("field_name"),
25+
SN_CONDITION_ROW("condition_row"),
26+
SEARCH("search");
27+
28+
private final String componentType;
29+
30+
SnComponentType(String componentType) {
31+
this.componentType = componentType;
32+
}
33+
34+
@Override
35+
public String toString() {
36+
return componentType;
37+
}
38+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package solutions.bellatrix.servicenow.components.enums;
2+
3+
public enum StyleAlignment {
4+
LEFT("left"),
5+
RIGHT("right"),
6+
CENTER("center");
7+
8+
private final String value;
9+
10+
StyleAlignment(String label) {
11+
this.value = label;
12+
}
13+
14+
public String getValue() {
15+
return "text-align: " + this.value + ";";
16+
}
17+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package solutions.bellatrix.servicenow.components.enums;
2+
3+
public enum UibComponentType {
4+
CHOICE("choice"),
5+
DATE("date"),
6+
DATE_TIME("date_time"),
7+
DOCUMENT_ID("document_id"),
8+
REFERENCE("reference"),
9+
STRING("string"),
10+
TEXTAREA("textarea"),
11+
TABLE_NAME("table_name"),
12+
PICK_LIST("pick_list"),
13+
BOOLEAN("boolean"),
14+
FLOAT("float"),
15+
INTEGER("integer"),
16+
PERCENT_COMPLETE("percent_complete"),
17+
CURRENCY_2("currency2"),
18+
GLIDE_LIST("glide_list"),
19+
GLIDE_TIME("glide_time"),
20+
DURATION("glide_duration"),
21+
HTML("html"),
22+
CURRENCY("currency2"),
23+
JOURNAL_INPUT("journal_input"),
24+
CURRENCY2("currency2"),
25+
FIELD_NAME("field_name"),
26+
SN_CONDITION_ROW("condition_row");
27+
28+
private final String componentType;
29+
30+
UibComponentType(String componentType) {
31+
this.componentType = componentType;
32+
}
33+
34+
@Override
35+
public String toString() {
36+
return componentType;
37+
}
38+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package solutions.bellatrix.servicenow.components.models;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
import lombok.experimental.SuperBuilder;
6+
7+
@Data
8+
@SuperBuilder
9+
public class ComponentFilterGroupModel {
10+
@SerializedName("operation")
11+
private String operation;
12+
@SerializedName("condition")
13+
private String condition;
14+
@SerializedName("operationType")
15+
private String operationType;
16+
@SerializedName("filterValue")
17+
private String filterValue;
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package solutions.bellatrix.servicenow.components.models;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
import lombok.experimental.SuperBuilder;
6+
7+
@Data
8+
@SuperBuilder
9+
public class ComponentFilterModel {
10+
@SerializedName("groupOperation")
11+
private String groupOperation;
12+
@SerializedName("groupedFilters")
13+
private ComponentFilterGroupModel[] vulnerability;
14+
}

0 commit comments

Comments
 (0)