Skip to content

Commit 99df540

Browse files
committed
Updated all javadoc for publishing to maven central
1 parent 9e756ed commit 99df540

File tree

64 files changed

+1275
-25
lines changed

Some content is hidden

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

64 files changed

+1275
-25
lines changed

database-test/src/test/java/com/codeheadsystems/test/datastore/DynamoDbExtensionTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,67 @@
2828
import org.junit.jupiter.api.Test;
2929
import org.junit.jupiter.api.extension.ExtendWith;
3030

31+
/**
32+
* The type Dynamo db extension test.
33+
*/
3134
@ExtendWith(DynamoDbExtension.class)
3235
class DynamoDbExtensionTest {
3336

37+
/**
38+
* The constant ATTRIBUTE.
39+
*/
3440
public static final String ATTRIBUTE = "aAttribute";
41+
/**
42+
* The constant RANGE.
43+
*/
3544
public static final String RANGE = "aRange";
45+
/**
46+
* The constant HASH.
47+
*/
3648
public static final String HASH = "aHash";
3749
@DataStore private DynamoDBMapper mapper;
3850
@DataStore private AmazonDynamoDB amazonDynamoDb;
3951

52+
/**
53+
* Sets .
54+
*/
4055
@BeforeEach
4156
void setup() {
4257
amazonDynamoDb.createTable(
4358
mapper.generateCreateTableRequest(Entry.class)
4459
.withBillingMode(BillingMode.PAY_PER_REQUEST));
4560
}
4661

62+
/**
63+
* Tear down.
64+
*/
4765
@AfterEach
4866
void tearDown() {
4967
// force the table empty
5068
amazonDynamoDb.deleteTable(mapper.generateDeleteTableRequest(Entry.class));
5169
}
5270

71+
/**
72+
* Test client.
73+
*/
5374
@Test
5475
void testClient() {
5576
assertThat(amazonDynamoDb)
5677
.isNotNull();
5778
}
5879

80+
/**
81+
* Test mapper.
82+
*/
5983
@Test
6084
void testMapper() {
6185
assertThat(mapper)
6286
.isNotNull();
6387
}
6488

89+
/**
90+
* Table exists and is empty.
91+
*/
6592
@Test
6693
void tableExistsAndIsEmpty() {
6794
final DynamoDBScanExpression expression = new DynamoDBScanExpression();
@@ -71,6 +98,9 @@ void tableExistsAndIsEmpty() {
7198
.isEmpty();
7299
}
73100

101+
/**
102+
* We can add items.
103+
*/
74104
@Test
75105
void weCanAddItems() {
76106
final Entry entry = new Entry(HASH, RANGE, ATTRIBUTE);

feature-flag-ddb-test/src/test/java/org/codeheadsystems/featureflag/manager/impl/DdbFeatureLookupManagerIntegTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@
77
import org.junit.jupiter.api.extension.ExtendWith;
88
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
99

10+
/**
11+
* The type Ddb feature lookup manager integ test.
12+
*/
1013
@ExtendWith(DynamoDbExtension.class)
1114
class DdbFeatureLookupManagerIntegTest extends FeatureLookupManagerIntegTest {
1215

1316
private static final DynamoDbConfiguration DB_CONFIGURATION = ImmutableDynamoDbConfiguration.builder().build();
1417

1518
@DataStore private DynamoDbClient dbClient;
1619

20+
/**
21+
* Sets database.
22+
*/
1723
@BeforeEach
1824
void setupDatabase() {
1925
final DdbControlPlane ddbControlPlane = new DdbControlPlane(DB_CONFIGURATION, dbClient);

feature-flag-etcd/src/test/java/org/codeheadsystems/featureflag/manager/impl/EtcdEnablementLookupManagerIntegTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,26 @@
1111
* A longer test that starts up an etcd process. But not really that long.
1212
*/
1313
public class EtcdEnablementLookupManagerIntegTest extends FeatureLookupManagerIntegTest {
14+
/**
15+
* The constant cluster.
16+
*/
1417
@RegisterExtension
1518
public static final EtcdClusterExtension cluster = EtcdClusterExtension.builder()
1619
.withNodes(1)
1720
.build();
1821
private Client client;
1922

23+
/**
24+
* Sets client.
25+
*/
2026
@BeforeEach
2127
void setupClient() {
2228
client = Client.builder().endpoints(cluster.clientEndpoints()).build();
2329
}
2430

31+
/**
32+
* Tear down client.
33+
*/
2534
@AfterEach
2635
void tearDownClient() {
2736
client.close();

feature-flag-etcd/src/test/java/org/codeheadsystems/featureflag/manager/impl/EtcdEnablementLookupManagerTest.java

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
import org.mockito.Mock;
3131
import org.mockito.junit.jupiter.MockitoExtension;
3232

33+
/**
34+
* The type Etcd enablement lookup manager test.
35+
*/
3336
@ExtendWith(MockitoExtension.class)
3437
class EtcdEnablementLookupManagerTest {
3538

@@ -56,11 +59,21 @@ private static ByteSequence getNamespaceKeyBytes() {
5659
}
5760

5861

62+
/**
63+
* Sets up.
64+
*/
5965
@BeforeEach
6066
void setUp() {
6167
etcdFeatureLookupManager = new EtcdFeatureLookupManager(client, PREAMBLE);
6268
}
6369

70+
/**
71+
* Lookup percentage found.
72+
*
73+
* @throws ExecutionException the execution exception
74+
* @throws InterruptedException the interrupted exception
75+
* @throws TimeoutException the timeout exception
76+
*/
6477
@Test
6578
void lookupPercentage_found() throws ExecutionException, InterruptedException, TimeoutException {
6679
when(client.getKVClient()).thenReturn(kv);
@@ -74,6 +87,13 @@ void lookupPercentage_found() throws ExecutionException, InterruptedException, T
7487
.contains(0.5);
7588
}
7689

90+
/**
91+
* Lookup percentage not found.
92+
*
93+
* @throws ExecutionException the execution exception
94+
* @throws InterruptedException the interrupted exception
95+
* @throws TimeoutException the timeout exception
96+
*/
7797
@Test
7898
void lookupPercentage_notFound() throws ExecutionException, InterruptedException, TimeoutException {
7999
when(client.getKVClient()).thenReturn(kv);
@@ -85,6 +105,13 @@ void lookupPercentage_notFound() throws ExecutionException, InterruptedException
85105
.isEmpty();
86106
}
87107

108+
/**
109+
* Lookup percentage interrupted.
110+
*
111+
* @throws ExecutionException the execution exception
112+
* @throws InterruptedException the interrupted exception
113+
* @throws TimeoutException the timeout exception
114+
*/
88115
@Test
89116
void lookupPercentage_interrupted() throws ExecutionException, InterruptedException, TimeoutException {
90117
when(client.getKVClient()).thenReturn(kv);
@@ -94,6 +121,13 @@ void lookupPercentage_interrupted() throws ExecutionException, InterruptedExcept
94121
.isThrownBy(() -> etcdFeatureLookupManager.lookupPercentage(FEATURE_ID));
95122
}
96123

124+
/**
125+
* Lookup percentage execution exception.
126+
*
127+
* @throws ExecutionException the execution exception
128+
* @throws InterruptedException the interrupted exception
129+
* @throws TimeoutException the timeout exception
130+
*/
97131
@Test
98132
void lookupPercentage_executionException() throws ExecutionException, InterruptedException, TimeoutException {
99133
when(client.getKVClient()).thenReturn(kv);
@@ -103,6 +137,12 @@ void lookupPercentage_executionException() throws ExecutionException, Interrupte
103137
.isThrownBy(() -> etcdFeatureLookupManager.lookupPercentage(FEATURE_ID));
104138
}
105139

140+
/**
141+
* Sets percentage.
142+
*
143+
* @throws ExecutionException the execution exception
144+
* @throws InterruptedException the interrupted exception
145+
*/
106146
@Test
107147
void setPercentage() throws ExecutionException, InterruptedException {
108148
when(client.getKVClient()).thenReturn(kv);
@@ -114,6 +154,12 @@ void setPercentage() throws ExecutionException, InterruptedException {
114154
verify(putResponseCompletableFuture).get();
115155
}
116156

157+
/**
158+
* Sets percentage interrupted.
159+
*
160+
* @throws ExecutionException the execution exception
161+
* @throws InterruptedException the interrupted exception
162+
*/
117163
@Test
118164
void setPercentage_interrupted() throws ExecutionException, InterruptedException {
119165
when(client.getKVClient()).thenReturn(kv);
@@ -123,6 +169,12 @@ void setPercentage_interrupted() throws ExecutionException, InterruptedException
123169
.isThrownBy(() -> etcdFeatureLookupManager.setPercentage(FEATURE_ID, 0.5));
124170
}
125171

172+
/**
173+
* Sets percentage execution exception.
174+
*
175+
* @throws ExecutionException the execution exception
176+
* @throws InterruptedException the interrupted exception
177+
*/
126178
@Test
127179
void setPercentage_executionException() throws ExecutionException, InterruptedException {
128180
when(client.getKVClient()).thenReturn(kv);
@@ -132,6 +184,12 @@ void setPercentage_executionException() throws ExecutionException, InterruptedEx
132184
.isThrownBy(() -> etcdFeatureLookupManager.setPercentage(FEATURE_ID, 0.5));
133185
}
134186

187+
/**
188+
* Delete percentage.
189+
*
190+
* @throws ExecutionException the execution exception
191+
* @throws InterruptedException the interrupted exception
192+
*/
135193
@Test
136194
void deletePercentage() throws ExecutionException, InterruptedException {
137195
when(client.getKVClient()).thenReturn(kv);
@@ -142,6 +200,12 @@ void deletePercentage() throws ExecutionException, InterruptedException {
142200
assertThat(values).containsExactly(PREAMBLE + "_" + NAMESPACE + "/" + FEATURE_ID);
143201
}
144202

203+
/**
204+
* Delete percentage interrupted.
205+
*
206+
* @throws ExecutionException the execution exception
207+
* @throws InterruptedException the interrupted exception
208+
*/
145209
@Test
146210
void deletePercentage_interrupted() throws ExecutionException, InterruptedException {
147211
when(client.getKVClient()).thenReturn(kv);
@@ -151,6 +215,12 @@ void deletePercentage_interrupted() throws ExecutionException, InterruptedExcept
151215
.isThrownBy(() -> etcdFeatureLookupManager.deletePercentage(FEATURE_ID));
152216
}
153217

218+
/**
219+
* Delete percentage execution exception.
220+
*
221+
* @throws ExecutionException the execution exception
222+
* @throws InterruptedException the interrupted exception
223+
*/
154224
@Test
155225
void deletePercentage_executionException() throws ExecutionException, InterruptedException {
156226
when(client.getKVClient()).thenReturn(kv);

feature-flag-integ/src/test/java/org/codeheadsystems/featureflag/manager/FullSqlTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ void setupSql(Metrics metrics, Jdbi jdbi) {
7676
.build();
7777
}
7878

79+
/**
80+
* Temporary test.
81+
*/
7982
@Test
8083
void temporaryTest() {
8184
// This is a temporary test

feature-flag-metrics/src/test/java/org/codeheadsystems/featureflag/manager/MetricsDecoratorTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
import org.mockito.Mock;
1010
import org.mockito.junit.jupiter.MockitoExtension;
1111

12+
/**
13+
* The type Metrics decorator test.
14+
*/
1215
@ExtendWith(MockitoExtension.class)
1316
class MetricsDecoratorTest {
1417

1518
@Mock private Metrics metrics;
1619

1720
@InjectMocks private MetricsDecorator metricsDecorator;
1821

22+
/**
23+
* Test decorate.
24+
*/
1925
@Test
2026
public void testDecorate() {
2127
FeatureManager.Builder builder = new FeatureManager.Builder();

feature-flag/src/test/java/org/codeheadsystems/featureflag/factory/EnablementFactoryTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
import org.mockito.Mock;
1717
import org.mockito.junit.jupiter.MockitoExtension;
1818

19+
/**
20+
* The type Enablement factory test.
21+
*/
1922
@ExtendWith(MockitoExtension.class)
2023
class EnablementFactoryTest {
2124

@@ -60,6 +63,13 @@ private static Stream<Arguments> provideGenerate() {
6063
);
6164
}
6265

66+
/**
67+
* Generate.
68+
*
69+
* @param featurePercentage the feature percentage
70+
* @param hashCodeInt the hash code int
71+
* @param expected the expected
72+
*/
6373
@ParameterizedTest
6474
@MethodSource("provideGenerate")
6575
void generate(final double featurePercentage, final int hashCodeInt, final boolean expected) {
@@ -70,16 +80,29 @@ void generate(final double featurePercentage, final int hashCodeInt, final boole
7080
.isEqualTo(expected);
7181
}
7282

83+
/**
84+
* Enabled feature.
85+
*/
7386
@Test
7487
void enabledFeature() {
7588
assertThat(enablementFactory.enabledFeature().enabled(TEST)).isTrue();
7689
}
7790

91+
/**
92+
* Disabled feature.
93+
*/
7894
@Test
7995
void disabledFeature() {
8096
assertThat(enablementFactory.disabledFeature().enabled(TEST)).isFalse();
8197
}
8298

99+
/**
100+
* Percentage feature.
101+
*
102+
* @param featurePercentage the feature percentage
103+
* @param hashCodeInt the hash code int
104+
* @param expected the expected
105+
*/
83106
@ParameterizedTest
84107
@MethodSource("provideGenerate")
85108
void percentageFeature(final double featurePercentage, final int hashCodeInt, final boolean expected) {

0 commit comments

Comments
 (0)