Skip to content

Commit 6c57740

Browse files
committed
added VisibleForTesting annotation
1 parent fb4a91c commit 6c57740

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/main/java/com/saasquatch/jsonschemainferrer/JsonSchemaInferrer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.fasterxml.jackson.databind.node.JsonNodeType;
2626
import com.fasterxml.jackson.databind.node.ObjectNode;
2727
import com.fasterxml.jackson.databind.node.ValueNode;
28+
import com.saasquatch.jsonschemainferrer.annotations.VisibleForTesting;
2829

2930
/**
3031
* Infer JSON schema based on sample JSONs. This class is immutable and thread safe.
@@ -332,8 +333,8 @@ private void postProcessAnyOfs(@Nonnull Collection<ObjectNode> anyOfs) {
332333
anyOfs.add(combinedSimpleAnyOf);
333334
}
334335

335-
// Visible for testing
336336
@Nonnull
337+
@VisibleForTesting
337338
String inferPrimitiveType(@Nonnull JsonNode sample, boolean allNumbersAreIntegers) {
338339
// Marker for whether the error is caused by a known type
339340
final JsonNodeType type = sample.getNodeType();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.saasquatch.jsonschemainferrer.annotations;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* Indicates that an element is only visible for testing.
8+
*
9+
* @author sli
10+
*/
11+
@Retention(RetentionPolicy.SOURCE) // Only used for documentation
12+
public @interface VisibleForTesting {
13+
14+
}

0 commit comments

Comments
 (0)