SimulatorConfiguration.java

1
package fr.sii.ogham.testing.sms.simulator.config;
2
3
import ogham.testing.io.github.resilience4j.retry.RetryConfig;
4
5
import java.util.List;
6
7
/**
8
 * Configuration for local server used to simulate a SMPP server.
9
 *
10
 * @author Aurélien Baudet
11
 */
12
public class SimulatorConfiguration {
13
    private ServerPortProvider portProvider;
14
    private List<Credentials> credentials;
15
    private ServerDelays serverDelays;
16
    private boolean keepMessages;
17
    private RetryConfig startRetryConfig;
18
19
    /**
20
     * Get the configuration that provides a port for the server
21
     *
22
     * @return the port configuration
23
     */
24
    public ServerPortProvider getPortProvider() {
25 1 1. getPortProvider : replaced return value with null for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getPortProvider → RUN_ERROR
        return portProvider;
26
    }
27
28
    /**
29
     * Set the configuration that provides a port for the server
30
     *
31
     * @param port the port configuration
32
     */
33
    public void setPort(ServerPortProvider port) {
34
        this.portProvider = port;
35
    }
36
37
    /**
38
     * Get the allowed credentials
39
     *
40
     * @return the allowed credentials
41
     */
42
    public List<Credentials> getCredentials() {
43 1 1. getCredentials : replaced return value with Collections.emptyList for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getCredentials → NO_COVERAGE
        return credentials;
44
    }
45
46
    /**
47
     * Set the allowed credentials
48
     *
49
     * @param credentials the allowed credentials
50
     */
51
    public void setCredentials(List<Credentials> credentials) {
52
        this.credentials = credentials;
53
    }
54
55
    /**
56
     * Control delays to simulate a slow server.
57
     *
58
     * @return the delay configuration
59
     */
60
    public ServerDelays getServerDelays() {
61 1 1. getServerDelays : replaced return value with null for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getServerDelays → RUN_ERROR
        return serverDelays;
62
    }
63
64
    /**
65
     * Control delays to simulate a slow server.
66
     *
67
     * @param serverDelays the delay configuration
68
     */
69
    public void setServerDelays(ServerDelays serverDelays) {
70
        this.serverDelays = serverDelays;
71
    }
72
73
    /**
74
     * If the server is restarted, it indicates if received messages in the
75
     * previous session should be kept (true) or dropped (false).
76
     *
77
     * @return indicate if messages should be kept or not between sessions
78
     */
79
    public boolean isKeepMessages() {
80 2 1. isKeepMessages : replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::isKeepMessages → RUN_ERROR
2. isKeepMessages : replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::isKeepMessages → RUN_ERROR
        return keepMessages;
81
    }
82
83
    /**
84
     * If the server is restarted, it indicates if received messages in the
85
     * previous session should be kept (true) or dropped (false).
86
     *
87
     * @param keepMessages indicate if messages should be kept or not between sessions
88
     */
89
    public void setKeepMessages(boolean keepMessages) {
90
        this.keepMessages = keepMessages;
91
    }
92
93
    /**
94
     * Server may not start correctly (because port was available but is not
95
     * available anymore for example).
96
     * <p>
97
     * In such case, the server will be restarted until it starts successfully, or
98
     * it fails due to maximum attempts reached.
99
     *
100
     * @return the retry config
101
     */
102
    public RetryConfig getStartRetryConfig() {
103 1 1. getStartRetryConfig : replaced return value with null for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getStartRetryConfig → RUN_ERROR
        return startRetryConfig;
104
    }
105
106
    /**
107
     * Server may not start correctly (because port was available but is not
108
     * available anymore for example).
109
     * <p>
110
     * In such case, the server will be restarted until it starts successfully, or
111
     * it fails due to maximum attempts reached.
112
     *
113
     * @param retryConfig the retry config
114
     */
115
    public void setStartRetryConfig(RetryConfig retryConfig) {
116
        this.startRetryConfig = retryConfig;
117
    }
118
119
    /**
120
     * Reset the configuration to be reused by the same server
121
     */
122
    public void reset() {
123 1 1. reset : removed call to fr/sii/ogham/testing/sms/simulator/config/ServerPortProvider::reset → NO_COVERAGE
        portProvider.reset();
124
    }
125
126
}

Mutations

25

1.1
Location : getPortProvider
Killed by :
replaced return value with null for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getPortProvider → RUN_ERROR

43

1.1
Location : getCredentials
Killed by :
replaced return value with Collections.emptyList for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getCredentials → NO_COVERAGE

61

1.1
Location : getServerDelays
Killed by :
replaced return value with null for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getServerDelays → RUN_ERROR

80

1.1
Location : isKeepMessages
Killed by :
replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::isKeepMessages → RUN_ERROR

2.2
Location : isKeepMessages
Killed by :
replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::isKeepMessages → RUN_ERROR

103

1.1
Location : getStartRetryConfig
Killed by :
replaced return value with null for fr/sii/ogham/testing/sms/simulator/config/SimulatorConfiguration::getStartRetryConfig → RUN_ERROR

123

1.1
Location : reset
Killed by :
removed call to fr/sii/ogham/testing/sms/simulator/config/ServerPortProvider::reset → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.13.1