1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.micronaut.build.testresources;
17
18 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
19 import com.fasterxml.jackson.annotation.JsonProperty;
20 import com.fasterxml.jackson.annotation.JsonRootName;
21 import org.apache.maven.plugins.annotations.Parameter;
22
23 import static io.micronaut.build.testresources.StopTestResourcesServerMojo.MICRONAUT_TEST_RESOURCES_KEEPALIVE;
24
25
26
27
28
29
30
31 @JsonRootName("configuration")
32 @JsonIgnoreProperties(ignoreUnknown = true)
33 public class TestResourcesConfiguration {
34
35 public static final String DISABLED = "false";
36 public static final String CONFIG_PROPERTY_PREFIX = "micronaut.test.resources.";
37
38 private static final String PROPERTY_ENABLED = "enabled";
39
40
41
42
43 @Parameter(property = CONFIG_PROPERTY_PREFIX + PROPERTY_ENABLED, defaultValue = DISABLED)
44 @JsonProperty(PROPERTY_ENABLED)
45 protected boolean testResourcesEnabled;
46
47
48
49
50
51 @Parameter(property = CONFIG_PROPERTY_PREFIX + "shared", defaultValue = DISABLED)
52 protected boolean shared;
53
54
55
56
57 @Parameter(property = MICRONAUT_TEST_RESOURCES_KEEPALIVE, defaultValue = DISABLED)
58 protected boolean keepAlive;
59
60
61
62
63
64
65
66 @Parameter(property = CONFIG_PROPERTY_PREFIX + "namespace")
67 protected String sharedServerNamespace;
68
69
70
71
72 public boolean isTestResourcesEnabled() {
73 return testResourcesEnabled;
74 }
75
76
77
78
79 public boolean isShared() {
80 return shared;
81 }
82
83
84
85
86 public boolean isKeepAlive() {
87 return keepAlive;
88 }
89
90
91
92
93 public String getSharedServerNamespace() {
94 return sharedServerNamespace;
95 }
96 }