chore: improve contrib guide (#863)
* improve contribution guide and remove deprecation Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com> * revert mockito bump Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com> * revert proposed change Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com> --------- Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
This commit is contained in:
parent
fb57fab7d3
commit
46d04feb4b
|
|
@ -8,7 +8,9 @@ be a jerk.
|
|||
|
||||
We're not keen on vendor-specific stuff in this library, but if there are changes that need to happen in the spec to enable vendor-specific stuff in user code or other extension points, check out [the spec](https://github.com/open-feature/spec).
|
||||
|
||||
Any contributions you make are expected to be tested with unit tests. You can validate these work with `gradle test`, or the automation itself will run them for you when you make a PR.
|
||||
Any contributions you make are expected to be tested with unit tests. You can validate these work with `mvn test`.
|
||||
Further, it is recommended to verify code styling and static code analysis with `mvn verify -P !deploy`.
|
||||
Regardless, the automation itself will run them for you when you open a PR.
|
||||
|
||||
Your code is supposed to work with Java 8+.
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class OpenFeatureClient implements Client {
|
|||
|
||||
/**
|
||||
* Deprecated public constructor. Use OpenFeature.API.getClient() instead.
|
||||
*
|
||||
*
|
||||
* @param openFeatureAPI Backing global singleton
|
||||
* @param name Name of the client (used by observability tools).
|
||||
* @param version Version of the client (used by observability tools).
|
||||
|
|
@ -43,7 +43,7 @@ public class OpenFeatureClient implements Client {
|
|||
* Clients created using it will not run event handlers.
|
||||
* Use the OpenFeatureAPI's getClient factory method instead.
|
||||
*/
|
||||
@Deprecated() // TODO: eventually we will make this non-public
|
||||
@Deprecated() // TODO: eventually we will make this non-public. See issue #872
|
||||
public OpenFeatureClient(OpenFeatureAPI openFeatureAPI, String name, String version) {
|
||||
this.openfeatureApi = openFeatureAPI;
|
||||
this.name = name;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
package dev.openfeature.sdk;
|
||||
|
||||
import dev.openfeature.sdk.fixtures.HookFixtures;
|
||||
import dev.openfeature.sdk.testutils.FeatureProviderTestUtils;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InOrder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
|
@ -13,23 +29,6 @@ import static org.mockito.Mockito.times;
|
|||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import dev.openfeature.sdk.testutils.FeatureProviderTestUtils;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InOrder;
|
||||
|
||||
import dev.openfeature.sdk.fixtures.HookFixtures;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
class HookSpecTest implements HookFixtures {
|
||||
@AfterEach
|
||||
void emptyApiHooks() {
|
||||
|
|
@ -500,7 +499,7 @@ class HookSpecTest implements HookFixtures {
|
|||
.hook(hook)
|
||||
.build());
|
||||
|
||||
ArgumentCaptor<MutableContext> captor = ArgumentCaptor.forClass(MutableContext.class);
|
||||
ArgumentCaptor<ImmutableContext> captor = ArgumentCaptor.forClass(ImmutableContext.class);
|
||||
verify(provider).getBooleanEvaluation(any(), any(), captor.capture());
|
||||
EvaluationContext ec = captor.getValue();
|
||||
assertEquals("works", ec.getValue("test").asString());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package dev.openfeature.sdk.fixtures;
|
||||
|
||||
import dev.openfeature.sdk.*;
|
||||
import dev.openfeature.sdk.BooleanHook;
|
||||
import dev.openfeature.sdk.DoubleHook;
|
||||
import dev.openfeature.sdk.Hook;
|
||||
import dev.openfeature.sdk.IntegerHook;
|
||||
import dev.openfeature.sdk.StringHook;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue