BeanInjection.java

1
package com.jsql.view.swing.list;
2
3
import com.jsql.model.injection.method.AbstractMethodInjection;
4
import com.jsql.model.injection.vendor.model.Vendor;
5
import com.jsql.view.swing.util.MediatorHelper;
6
import org.apache.commons.lang3.StringUtils;
7
8
import java.util.NoSuchElementException;
9
10
public class BeanInjection {
11
    
12
    private final String url;
13
    private String request = StringUtils.EMPTY;
14
    private String header = StringUtils.EMPTY;
15
    private String requestType;
16
    
17
    private AbstractMethodInjection method;
18
    private Vendor vendor;
19
20
    public BeanInjection(String url) {
21
        
22
        this.url = url;
23
        this.method = MediatorHelper.model().getMediatorMethod().getQuery();
24
        this.vendor = MediatorHelper.model().getMediatorVendor().getAuto();
25
        this.requestType = "GET";
26
    }
27
    
28
    public BeanInjection(String url, String request, String header, String nameMethod, String vendor, String requestType) {
29
        
30
        this(url);
31
        
32
        this.request = request;
33
        this.header = header;
34
        
35
        try {
36
            this.method = MediatorHelper.model()
37
                .getMediatorMethod()
38
                .getMethods()
39
                .stream()
40 2 1. lambda$new$0 : replaced boolean return with true for com/jsql/view/swing/list/BeanInjection::lambda$new$0 → NO_COVERAGE
2. lambda$new$0 : replaced boolean return with false for com/jsql/view/swing/list/BeanInjection::lambda$new$0 → NO_COVERAGE
                .filter(m -> m.name().equalsIgnoreCase(nameMethod))
41
                .findAny()
42
                .orElse(MediatorHelper.model().getMediatorMethod().getQuery());
43
        } catch (IllegalArgumentException | NoSuchElementException e) {
44
            this.method = MediatorHelper.model().getMediatorMethod().getQuery();
45
        }
46
        
47
        try {
48
            this.vendor = MediatorHelper.model()
49
                .getMediatorVendor()
50
                .getVendors()
51
                .stream()
52 2 1. lambda$new$1 : replaced boolean return with true for com/jsql/view/swing/list/BeanInjection::lambda$new$1 → NO_COVERAGE
2. lambda$new$1 : replaced boolean return with false for com/jsql/view/swing/list/BeanInjection::lambda$new$1 → NO_COVERAGE
                .filter(v -> v.toString().equals(vendor))
53
                .findAny()
54
                .orElse(MediatorHelper.model().getMediatorVendor().getAuto());
55
        } catch (IllegalArgumentException | NoSuchElementException e) {
56
            this.vendor = MediatorHelper.model().getMediatorVendor().getAuto();
57
        }
58
        
59 1 1. <init> : negated conditional → NO_COVERAGE
        this.requestType = requestType.isEmpty()
60
            ? "GET"
61
            : requestType;
62
    }
63
    
64
    
65
    // Json getter for serialization
66
    
67
    public String getMethod() {
68 1 1. getMethod : replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getMethod → NO_COVERAGE
        return this.method.name();
69
    }
70
    
71
    public String getVendor() {
72 1 1. getVendor : replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getVendor → NO_COVERAGE
        return this.vendor.toString();
73
    }
74
    
75
    
76
    // Getter and setter
77
78
    public String getUrl() {
79 1 1. getUrl : replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getUrl → NO_COVERAGE
        return this.url;
80
    }
81
82
    public String getRequest() {
83 1 1. getRequest : replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getRequest → NO_COVERAGE
        return this.request;
84
    }
85
86
    public String getHeader() {
87 1 1. getHeader : replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getHeader → NO_COVERAGE
        return this.header;
88
    }
89
    
90
    public String getRequestType() {
91 1 1. getRequestType : replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getRequestType → NO_COVERAGE
        return this.requestType;
92
    }
93
94
    public AbstractMethodInjection getMethodInstance() {
95 1 1. getMethodInstance : replaced return value with null for com/jsql/view/swing/list/BeanInjection::getMethodInstance → NO_COVERAGE
        return this.method;
96
    }
97
}

Mutations

40

1.1
Location : lambda$new$0
Killed by : none
replaced boolean return with true for com/jsql/view/swing/list/BeanInjection::lambda$new$0 → NO_COVERAGE

2.2
Location : lambda$new$0
Killed by : none
replaced boolean return with false for com/jsql/view/swing/list/BeanInjection::lambda$new$0 → NO_COVERAGE

52

1.1
Location : lambda$new$1
Killed by : none
replaced boolean return with true for com/jsql/view/swing/list/BeanInjection::lambda$new$1 → NO_COVERAGE

2.2
Location : lambda$new$1
Killed by : none
replaced boolean return with false for com/jsql/view/swing/list/BeanInjection::lambda$new$1 → NO_COVERAGE

59

1.1
Location : <init>
Killed by : none
negated conditional → NO_COVERAGE

68

1.1
Location : getMethod
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getMethod → NO_COVERAGE

72

1.1
Location : getVendor
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getVendor → NO_COVERAGE

79

1.1
Location : getUrl
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getUrl → NO_COVERAGE

83

1.1
Location : getRequest
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getRequest → NO_COVERAGE

87

1.1
Location : getHeader
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getHeader → NO_COVERAGE

91

1.1
Location : getRequestType
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/BeanInjection::getRequestType → NO_COVERAGE

95

1.1
Location : getMethodInstance
Killed by : none
replaced return value with null for com/jsql/view/swing/list/BeanInjection::getMethodInstance → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1