id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
85239682_131
{ "fields": [], "file": "jaxrs-api/src/test/java/se/fortnox/reactivewizard/jaxrs/WebExceptionTest.java", "identifier": "WebExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotSetErrorCodeToInternalWhenStatusIs500IfErrorCodeWasPassed() {\n WebException webException = new WebException(INTERNAL_SERVER_ERROR, \"anything\");\n assertThat(webException.getError()).isEqualTo(\"anything\");\n }", "class_method_signature": "WebExceptionT...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "error", "modifier": "private", "original_string": "private String error;", ...
{ "body": "public String getError() {\n return error;\n }", "class_method_signature": "WebException.getError()", "constructor": false, "full_signature": "public String getError()", "identifier": "getError", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_91
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotDoIfObservableFails() {\n Observable<Object> observable = error(new RuntimeException());\n\n Consumer<Boolean> thenMock = mock(Consumer.class);\n try {\n RxUtils.doIfEmpty(observable, () -> thenMock.accept(true)).toBlocking().subscribe();\n ...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> doIfEmpty(Observable<T> output, Action0 action) {\n return output.doOnEach(new Observer<T>() {\n AtomicBoolean empty = new AtomicBoolean(true);\n\n @Override\n public void onCompleted() {\n if (empty.get()) {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_52
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanNotNullDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanNotNullDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIA...
{ "body": "@Test\n public void shouldDeserializeFalse() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"false\")).isEqualTo(false);\n assertThat(DESERIALIZER.deserialize(\"FALSE\")).isEqualTo(false);\n assertThat(DESERIALIZER.deserialize(\"False\")).isEqualTo(false);\n ...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanNotNullDeserializer.java", "identifier": "BooleanNotNullDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanNotNullDeserializer.deser...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n if (value == null) {\n throw new DeserializerException(\"invalid.boolean\");\n }\n return Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanNotNullDeserializer....
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_44
{ "fields": [ { "declarator": "DESERIALIZER = new DateDeserializer(StdDateFormat::new)", "modifier": "private final static", "original_string": "private final static Deserializer<Date> DESERIALIZER = new DateDeserializer(StdDateFormat::new);", "type": "Deserializer<Date>", "var_name"...
{ "body": "@Test\n public void shouldDeserialize() throws DeserializerException {\n Date deserialized = DESERIALIZER.deserialize(\"2010-01-01\");\n assertThat(deserialized.toString()).isEqualTo(\"Fri Jan 01 00:00:00 UTC 2010\");\n }", "class_method_signature": "DateDeserializerTest.shouldDeseria...
{ "fields": [ { "declarator": "dateFormatProvider", "modifier": "private", "original_string": "private Provider<DateFormat> dateFormatProvider;", "type": "Provider<DateFormat>", "var_name": "dateFormatProvider" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs...
{ "body": "@Override\n public Date deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n try {\n return new Date(Long.parseLong(value));\n } catch (NumberFormatException e) {\n try {\n return ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_13
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldSerializeAndDeserializeMutableObjects() {\n Function<MutableEntity, String> serializer = serializerFactory.createStringSerializer(MutableEntity.class);\n String json = serializer.apply(mutableEntity);\n\n Function<String, MutableEntity> deserializer = deser...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<String, T> createDeserializer(TypeReference<T> typeReference) {\n return createDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createDeserializer(TypeReference<T> typeReference)", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_64
{ "fields": [ { "declarator": "interceptor = new JaxRsRequestContextInterceptor()", "modifier": "private", "original_string": "private JaxRsRequestContextInterceptor interceptor = new JaxRsRequestContextInterceptor();", "type": "JaxRsRequestContextInterceptor", "var_name": "intercept...
{ "body": "@Test\n public void shouldOpenContextOnHandle() {\n interceptor.preHandle(null);\n assertThat(JaxRsRequestContext.getContext()).isNotNull();\n }", "class_method_signature": "JaxRsRequestContextInterceptorTest.shouldOpenContextOnHandle()", "constructor": false, "full_signature": "@...
{ "fields": [], "file": "jaxrs-context/src/main/java/se/fortnox/reactivewizard/jaxrs/context/JaxRsRequestContextInterceptor.java", "identifier": "JaxRsRequestContextInterceptor", "interfaces": "implements JaxRsResourceInterceptor", "methods": [ { "class_method_signature": "JaxRsRequestContextInterce...
{ "body": "@Override\n public void preHandle(JaxRsResourceContext context) {\n JaxRsRequestContext.open();\n }", "class_method_signature": "JaxRsRequestContextInterceptor.preHandle(JaxRsResourceContext context)", "constructor": false, "full_signature": "@Override public void preHandle(JaxRsResource...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_33
{ "fields": [ { "declarator": "DESERIALIZER = new LocalDateDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<LocalDate> DESERIALIZER = new LocalDateDeserializer();", "type": "Deserializer<LocalDate>", "var_name": "DESERIALIZER"...
{ "body": "@Test\n public void shouldDeserialize() throws DeserializerException {\n LocalDate deserialized = DESERIALIZER.deserialize(\"2010-01-01\");\n assertThat(deserialized.toString()).isEqualTo(\"2010-01-01\");\n }", "class_method_signature": "LocalDateDeserializerTest.shouldDeserialize()",...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\")", "modifier": "private static final", "original_string": "private static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\");", "type": "TimeZone", "var_name": "DEF...
{ "body": "@Override\n public LocalDate deserialize(String value) throws DeserializerException {\n if (value == null || value.length() == 0) {\n return null;\n }\n\n try {\n return LocalDate.parse(value);\n } catch (DateTimeParseException e) {\n LOG.warn...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_25
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/JaxRsMetaTest.java", "identifier": "JaxRsMetaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotReturnJaxRsClassFromInterface() {\n Optional<Class<?>> jaxRsClass = JaxRsMeta.getJaxRsClass(ResourceInterface.class);\n assertThat(jaxRsClass.isPresent()).isFalse();\n }", "class_method_signature": "JaxRsMetaTest.shouldNotReturnJaxRsClassFromInterface()", ...
{ "fields": [ { "declarator": "method = null", "modifier": "private", "original_string": "private HttpMethod method = null;", "type": "HttpMethod", "var_name": "method" }, { "declarator": "methodPath = null", "modifier": "private", "original_string":...
{ "body": "public static Optional<Class<?>> getJaxRsClass(Class<?> cls) {\n if (!cls.isInterface()) {\n if (cls.getAnnotation(Path.class) != null) {\n return Optional.of(cls);\n }\n\n for (Class<?> iface : cls.getInterfaces()) {\n if (iface.getAnno...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_72
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Setter value;", "type": "Setter", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private", "original_string": "private Setter longObservable;", ...
{ "body": "@Test\n public void shouldGetParameterType() {\n assertThat(value.getParameterType()).isEqualTo(Integer.class);\n assertThat(genericSuperKey.getParameterType()).isEqualTo(String.class);\n assertThat(genericSuperValue.getParameterType()).isEqualTo(Integer.class);\n assertThat(...
{ "fields": [ { "declarator": "setterLambda", "modifier": "private final", "original_string": "private final BiConsumer<I, T> setterLambda;", "type": "BiConsumer<I, T>", "var_name": "setterLambda" }, { "declarator": "parameterType", "modifier": "private final", ...
{ "body": "@Override\n public Class<?> getParameterType() {\n return parameterType;\n }", "class_method_signature": "MethodSetter.getParameterType()", "constructor": false, "full_signature": "@Override public Class<?> getParameterType()", "identifier": "getParameterType", "invocations": [], "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_146
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldEncodePathAndQueryWithColon() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n Method method = TestResource.class.getMethod(\"withPathAndQueryParam\", String.class, String.class);\n String path = clie...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String getPath(Method method, Object[] arguments, JaxRsMeta meta) {\n String path = meta.getFullPath();\n\n StringBuilder query = null;\n Class<?>[] types = method.getParameterTypes();\n List<Object> args = new ArrayList<>(asList(arguments));\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_3
{ "fields": [ { "declarator": "serializerFactory = new JsonSerializerFactory()", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory = new JsonSerializerFactory();", "type": "JsonSerializerFactory", "var_name": "serializerFactory" } ], ...
{ "body": "@Test\n\tpublic void shouldSerializeUsingFieldProp() {\n\t\tPrivateEntity entity = new PrivateEntity();\n\t\tentity.fieldProp = \"hello\";\n\t\tFunction<PrivateEntity, String> serializer = serializerFactory.createStringSerializer(PrivateEntity.class);\n\n\t\tassertThat(serializer.apply(entity)).isEqualTo(\...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonSerializerFactory.java", "identifie...
{ "body": "public <T> Function<T, String> createStringSerializer(TypeReference<T> paramType) {\n return createStringSerializer(mapper.writerFor(paramType));\n }", "class_method_signature": "JsonSerializerFactory.createStringSerializer(TypeReference<T> paramType)", "constructor": false, "full_signature...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_111
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/CompoundKeyTest.java", "identifier": "CompoundKeyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldBeComparableWhenSame() {\n CompoundKey key1 = new CompoundKey(\"one\", \"two\", \"three\");\n CompoundKey key2 = new CompoundKey(\"one\", \"two\", \"three\");\n\n assertThat(key1).isEqualTo(key2);\n assertThat(key1.hashCode()).isEqualTo(key2.hashCode...
{ "fields": [ { "declarator": "keys", "modifier": "private", "original_string": "private Object[] keys;", "type": "Object[]", "var_name": "keys" } ], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/CompoundKey.java", "identifier": "CompoundKey", "interfaces": ...
{ "body": "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n for (Object k : keys) {\n result = result * prime + (k == null ? 0 : k.hashCode());\n }\n return result;\n }", "class_method_signature": "CompoundKey.hashCode()", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_48
{ "fields": [ { "declarator": "DESERIALIZER = new ArrayDeserializer((str) -> str, String.class)", "modifier": "private final static", "original_string": "private final static Deserializer<String[]> DESERIALIZER = new ArrayDeserializer((str) -> str, String.class);", "type": "Deserializer<St...
{ "body": "@Test\n public void shouldDeserializeCommaSeparatedStrings() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"entry\")).hasSize(1);\n assertThat(DESERIALIZER.deserialize(\"entry,second,third\")).hasSize(3);\n }", "class_method_signature": "ArrayDeserializerTest.s...
{ "fields": [ { "declarator": "inner", "modifier": "private final", "original_string": "private final Deserializer<T> inner;", "type": "Deserializer<T>", "var_name": "inner" }, { "declarator": "arrayType", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public T[] deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n String[] rawValues = value.split(\",\");\n try {\n T[] deserialized = (T[])Array.newInstance(arrayType, rawValues.length);\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_107
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/PropertyResolverTest.java", "identifier": "PropertyResolverTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() {\n PropertyResolver.from(Mutable.class, new String[]{\"anInt\"}).get().toString();\n }", "class_method_signature": "PropertyResolverTest.testToString()", "constructor": false, "full_signature": "@Test public void testToString()", "identifier": "testT...
{ "fields": [ { "declarator": "genericType", "modifier": "private final", "original_string": "private final Type genericType;", "type": "Type", "var_name": "genericType" }, { "declarator": "properties", "modifier": "private final", "original_string": "...
{ "body": "@Override\n public String toString() {\n return Arrays.toString(properties);\n }", "class_method_signature": "PropertyResolver.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "toString" ], "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_150
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldWrapAndReturnNewFullResponseObservable() {\n DisposableServer server = startServer(HttpResponseStatus.OK, \"\\\"OK\\\"\");\n\n TestResource resource = getHttpProxy(server.port());\n\n Observable<String> hello = resource.getHello();\n\n ObservableWith...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "public static <T> Observable<Response<T>> getFullResponse(Observable<T> source) {\n if (!(source instanceof ObservableWithResponse)) {\n throw new IllegalArgumentException(\"Must be used with observable returned from api call\");\n }\n\n return source.map(data -> new Respons...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_14
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldSerializeAndDeserializeJdk8Types() {\n Function<Jdk8Types, String> serializer = serializerFactory.createStringSerializer(Jdk8Types.class);\n String json = serializer.apply(jdk8Types);\n\n Function<String, Jdk8Types> deserializer = deserializerFactory.create...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<String, T> createDeserializer(TypeReference<T> typeReference) {\n return createDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createDeserializer(TypeReference<T> typeReference)", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_43
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIALIZER" } ...
{ "body": "@Test\n public void shouldDeserializeNull() throws DeserializerException {\n Boolean deserialized = DESERIALIZER.deserialize(null);\n assertThat(deserialized).isNull();\n }", "class_method_signature": "BooleanDeserializerTest.shouldDeserializeNull()", "constructor": false, "full_s...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanDeserializer.java", "identifier": "BooleanDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanDeserializer.deserialize(String value)"...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n return (value == null) ? null : Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanDeserializer.deserialize(String value)", "constructor": false, "full_signature": "@Override public ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_55
{ "fields": [ { "declarator": "DESERIALIZER = new ListDeserializer((str) -> str)", "modifier": "private final static", "original_string": "private final static Deserializer<List<String>> DESERIALIZER = new ListDeserializer((str) -> str);", "type": "Deserializer<List<String>>", "var_n...
{ "body": "@Test\n public void shouldDeserializeCommaSeparatedStrings() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"entry\")).hasSize(1);\n assertThat(DESERIALIZER.deserialize(\"entry,second,third\")).hasSize(3);\n }", "class_method_signature": "ListDeserializerTest.sh...
{ "fields": [ { "declarator": "inner", "modifier": "private final", "original_string": "private final Deserializer<T> inner;", "type": "Deserializer<T>", "var_name": "inner" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/ListDeserialize...
{ "body": "@Override\n public List<T> deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n\n if (value.isEmpty()) {\n return Collections.emptyList();\n }\n\n String[] rawValues = value.split(\",\");\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_8
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldDeserializeByteArrayNullToNull() {\n Function<byte[], ImmutableEntity> deserializer = deserializerFactory.createByteDeserializer(ImmutableEntity.class);\n\n ImmutableEntity result = deserializer.apply(null);\n\n assertThat(result).isNull();\n }", "clas...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<byte[], T> createByteDeserializer(TypeReference<T> typeReference) {\n return createByteDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createByteDeserializer(TypeReference<T> typeReference)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_96
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void noItemsShouldReturnEmpty() {\n Observable<Foo> fooObservable = RxUtils.singleOrEmpty(just(new ArrayList<>()));\n\n assertThat(fooObservable.toList().toBlocking().single()).isEmpty();\n }", "class_method_signature": "RxUtilsTest.noItemsShouldReturnEmpty()", "const...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {\n return collectionObservable.toList().concatMap(lists -> {\n if (lists.size() > 1) {\n return Observable.error(new IllegalArgumentException(\"Observable contains more ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_79
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldSupportNullsOnSetterPath() {\n Parent parent = new Parent();\n BiConsumer<Parent, Integer> setter = ReflectionUtil.<Parent,Integer>setter(Parent.class, \"inner.i\").get();\n\n setter.accept(parent, 7);\n\n assertThat(parent.getInner().getI()).isEqual...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "public static <I,T> Optional<BiConsumer<I,T>> setter(Class<I> instanceCls, String propertyPath) {\n Optional<PropertyResolver> propertyResolver = ReflectionUtil.getPropertyResolver(instanceCls, propertyPath.split(\"\\\\.\"));\n return propertyResolver.map(PropertyResolver::setter);\n\n }",...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_136
{ "fields": [], "file": "client/src/test/java/se/fortnox/reactivewizard/client/HttpClientProviderTest.java", "identifier": "HttpClientProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldCreateInstanceOfHttpClient() throws URISyntaxException {\n Injector injector = TestInjector.create(binder -> {\n binder.bind(ServerConfig.class).toInstance(new ServerConfig(){{\n setEnabled(false);\n }});\n });\n HttpCli...
{ "fields": [ { "declarator": "objectMapper", "modifier": "protected final", "original_string": "protected final ObjectMapper objectMapper;", "type": "ObjectMapper", "var_name": "objectMapper" }, { "declarator": "requestParame...
{ "body": "public HttpClient createClient(HttpClientConfig httpClientConfig) {\n return instantiateClient(httpClientConfig, getRxClientProvider(httpClientConfig));\n }", "class_method_signature": "HttpClientProvider.createClient(HttpClientConfig httpClientConfig)", "constructor": false, "full_signatur...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_161
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldHandleUnsafeSecureOnUntrustedHost() throws URISyntaxException, CertificateException {\n\n SelfSignedCertificate cert =new SelfSignedCertificate();\n SslContextBuilder serverOptions = SslContextBuilder.forServer(cert.certificate(), cert.privateKey());\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_38
{ "fields": [ { "declarator": "DESERIALIZER = new UUIDDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<UUID> DESERIALIZER = new UUIDDeserializer();", "type": "Deserializer<UUID>", "var_name": "DESERIALIZER" } ], "file"...
{ "body": "@Test\n public void shouldNotDeserializeNull() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(null)).isNull();\n }", "class_method_signature": "UUIDDeserializerTest.shouldNotDeserializeNull()", "constructor": false, "full_signature": "@Test public void shouldNotDese...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/UUIDDeserializer.java", "identifier": "UUIDDeserializer", "interfaces": "implements Deserializer<UUID>", "methods": [ { "class_method_signature": "UUIDDeserializer.deserialize(String value)", "con...
{ "body": "@Override\n public UUID deserialize(String value) throws DeserializerException {\n try {\n return value == null || value.equals(\"\") ? null : UUID.fromString(value);\n } catch (Exception e) {\n throw new DeserializerException(\"invalid.uuid\");\n }\n }", ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_80
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldThrowHelpfulExceptionWhenNoZeroParametersConstructorExists() {\n try {\n ReflectionUtil.instantiator(NoZeroParametersConstructorClass.class).get();\n fail(\"Expected RuntimeException, but none was thrown\");\n } catch (RuntimeException excep...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "public static <T> Supplier<T> instantiator(Class<T> cls) {\n try {\n Constructor<?> constructor = Stream.of(cls.getDeclaredConstructors())\n .filter(c -> c.getParameterCount() == 0)\n .findFirst()\n .orElseThrow(NoSuchMethodExceptio...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_120
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/db/deserializing/MutabilityDetectorTest.java", "identifier": "MutabilityDetectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldIgnoreSyntheticMembers() throws Exception {\n Class<?> withSynthetic = createClassWithSyntheticMembers();\n assertThat(MutabilityDetector.isImmutable(withSynthetic)).isTrue();\n }", "class_method_signature": "MutabilityDetectorTest.shouldIgnoreSyntheticMember...
{ "fields": [], "file": "dao/src/main/java/se/fortnox/reactivewizard/db/deserializing/MutabilityDetector.java", "identifier": "MutabilityDetector", "interfaces": "", "methods": [ { "class_method_signature": "MutabilityDetector.isImmutable(Class<?> cls)", "constructor": false, "full_signa...
{ "body": "static boolean isImmutable(Class<?> cls) {\n return !hasSetterMethod(cls) && !hasNoArgConstructor(cls) && !hasNonFinalField(cls);\n }", "class_method_signature": "MutabilityDetector.isImmutable(Class<?> cls)", "constructor": false, "full_signature": "static boolean isImmutable(Class<?> cls)...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_157
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldNotSendHeaderParamsAsPostBody() {\n AtomicReference<HttpServerRequest> recordedRequest = new AtomicReference<>();\n AtomicReference<String> recordedRequestBody = new AtomicReference<>();\n DisposableServer server = HttpServer.create(...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_18
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/RequestLoggerTest.java", "identifier": "RequestLoggerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldRedactAuthorizationValue() {\n Map.Entry<String,String> header = new AbstractMap.SimpleEntry<>(\"Authorization\", \"secret\");\n\n String result = RequestLogger.getHeaderValueOrRedact(header);\n assertEquals(result, \"REDACTED\");\n }", "class_method_s...
{ "fields": [ { "declarator": "logger", "modifier": "private final", "original_string": "private final Logger logger;", "type": "Logger", "var_name": "logger" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/RequestLogger.java", "identifier": "RequestLogger...
{ "body": "public static String getHeaderValueOrRedact(Map.Entry<String, String> header) {\n if (header == null) {\n return null;\n } else if (\"Authorization\".equalsIgnoreCase(header.getKey())) {\n return \"REDACTED\";\n }\n return header.getValue();\n }", "cla...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_100
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = NoSuchElementException.class)\n public void shouldAggregateExceptions() {\n Observable<List<Foo>> error = Observable.error(new NoSuchElementException());\n\n RxUtils.singleOrEmpty(error).toBlocking().subscribe();\n }", "class_method_signature": "RxUtilsTest.shouldAggr...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {\n return collectionObservable.toList().concatMap(lists -> {\n if (lists.size() > 1) {\n return Observable.error(new IllegalArgumentException(\"Observable contains more ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_116
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/util/CamelSnakeConverterTest.java", "identifier": "CamelSnakeConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldConvertToSnake() {\n assertThat(CamelSnakeConverter.camelToSnake(\"AAA\")).isEqualTo(\"aaa\");\n assertThat(CamelSnakeConverter.camelToSnake(\"aaaAaaAaa\")).isEqualTo(\"aaa_aaa_aaa\");\n assertThat(CamelSnakeConverter.camelToSnake(\"aA\")).isEqualTo(\"a_a\"...
{ "fields": [ { "declarator": "camelRegex = Pattern.compile(\"([a-z])([A-Z]+)\")", "modifier": "private static final", "original_string": "private static final Pattern camelRegex = Pattern.compile(\"([a-z])([A-Z]+)\");", "type": "Pattern", "var_name": "camelRegex" }, ...
{ "body": "public static String camelToSnake(String camelString) {\n return camelRegex.matcher(camelString).replaceAll(snakeReplacement).toLowerCase();\n }", "class_method_signature": "CamelSnakeConverter.camelToSnake(String camelString)", "constructor": false, "full_signature": "public static String ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_59
{ "fields": [ { "declarator": "service = new TestresourceImpl()", "modifier": "private final", "original_string": "private final TestresourceInterface service = new TestresourceImpl();", "type": "TestresourceInterface", "var_name": "service" } ], "file": "jaxrs/src/test/java/...
{ "body": "@Test\n public void shouldConcatPaths() throws InvocationTargetException, IllegalAccessException {\n JaxRsResources resources = new JaxRsResources(new Object[]{new Testresource()}, new JaxRsResourceFactory(), false);\n JaxRsRequest jaxRsRequest = new JaxRsRequest(new MockHttpServerReq...
{ "fields": [ { "declarator": "REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class))", "modifier": "private static final", "original_string": "private static final RequestLogger REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class));", "...
{ "body": "protected Mono<JaxRsResult<T>> call(JaxRsRequest request) {\n return request.loadBody()\n .flatMap(this::resolveArgs)\n .map(this::call);\n }", "class_method_signature": "JaxRsResource.call(JaxRsRequest request)", "constructor": false, "full_signature": "protected Mono...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_141
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldEncodePath() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n Method method = TestResource.class.getMethod(\"withPathAndQueryParam\", String.class, String.class);\n String path = client.getPath(method...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String getPath(Method method, Object[] arguments, JaxRsMeta meta) {\n String path = meta.getFullPath();\n\n StringBuilder query = null;\n Class<?>[] types = method.getParameterTypes();\n List<Object> args = new ArrayList<>(asList(arguments));\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_4
{ "fields": [ { "declarator": "serializerFactory = new JsonSerializerFactory()", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory = new JsonSerializerFactory();", "type": "JsonSerializerFactory", "var_name": "serializerFactory" } ], ...
{ "body": "@Test\n\tpublic void shouldSerializeFromType() throws NoSuchMethodException {\n\t\tMethod method = this.getClass().getDeclaredMethod(\"methodReturningListOfString\");\n\t\tType type = method.getGenericReturnType();\n\t\tFunction<List<String>, String> serializeList = serializerFactory.createStringSerializer...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonSerializerFactory.java", "identifie...
{ "body": "public <T> Function<T, String> createStringSerializer(TypeReference<T> paramType) {\n return createStringSerializer(mapper.writerFor(paramType));\n }", "class_method_signature": "JsonSerializerFactory.createStringSerializer(TypeReference<T> paramType)", "constructor": false, "full_signature...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_75
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldInstantiate() {\n assertThat(ReflectionUtil.instantiator(Parent.class).get()).isNotNull();\n assertThat(ReflectionUtil.instantiator(Child.class).get()).isNotNull();\n assertThat(ReflectionUtil.instantiator(PrivateDefaultConstructor.class).get()).isNotNull()...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "public static <T> Supplier<T> instantiator(Class<T> cls) {\n try {\n Constructor<?> constructor = Stream.of(cls.getDeclaredConstructors())\n .filter(c -> c.getParameterCount() == 0)\n .findFirst()\n .orElseThrow(NoSuchMethodExceptio...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_22
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/RequestLoggerTest.java", "identifier": "RequestLoggerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnNull_getHeaderValueOrRedact() {\n assertNull(RequestLogger.getHeaderValueOrRedact(null));\n }", "class_method_signature": "RequestLoggerTest.shouldReturnNull_getHeaderValueOrRedact()", "constructor": false, "full_signature": "@Test public void shouldReturn...
{ "fields": [ { "declarator": "logger", "modifier": "private final", "original_string": "private final Logger logger;", "type": "Logger", "var_name": "logger" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/RequestLogger.java", "identifier": "RequestLogger...
{ "body": "public static String getHeaderValueOrRedact(Map.Entry<String, String> header) {\n if (header == null) {\n return null;\n } else if (\"Authorization\".equalsIgnoreCase(header.getKey())) {\n return \"REDACTED\";\n }\n return header.getValue();\n }", "cla...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_34
{ "fields": [ { "declarator": "DESERIALIZER = new LocalDateDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<LocalDate> DESERIALIZER = new LocalDateDeserializer();", "type": "Deserializer<LocalDate>", "var_name": "DESERIALIZER"...
{ "body": "@Test\n public void shouldDeserializeTimestampsInMilliseconds() throws DeserializerException {\n LocalDate deserialized = DESERIALIZER.deserialize(\"1262304000000\");\n assertThat(deserialized.toString()).isEqualTo(\"2010-01-01\");\n }", "class_method_signature": "LocalDateDeserialize...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\")", "modifier": "private static final", "original_string": "private static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\");", "type": "TimeZone", "var_name": "DEF...
{ "body": "@Override\n public LocalDate deserialize(String value) throws DeserializerException {\n if (value == null || value.length() == 0) {\n return null;\n }\n\n try {\n return LocalDate.parse(value);\n } catch (DateTimeParseException e) {\n LOG.warn...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_63
{ "fields": [], "file": "jaxrs-context/src/test/java/se/fortnox/reactivewizard/jaxrs/context/JaxRsRequestContextTest.java", "identifier": "JaxRsRequestContextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalStateException.class)\n public void shouldFailOnReentry() {\n JaxRsRequestContext.open();\n }", "class_method_signature": "JaxRsRequestContextTest.shouldFailOnReentry()", "constructor": false, "full_signature": "@Test(expected = IllegalStateException.class) public...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(JaxRsRequestContext.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(JaxRsRequestContext.class);", "type": "Logger", ...
{ "body": "public static void open() {\n if (CONTEXT.get() != null) {\n throw new IllegalStateException(\"A context already exists\");\n }\n CONTEXT.set(new JaxRsRequestContext());\n }", "class_method_signature": "JaxRsRequestContext.open()", "constructor": false, "full_signat...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_62
{ "fields": [ { "declarator": "service = new TestresourceImpl()", "modifier": "private final", "original_string": "private final TestresourceInterface service = new TestresourceImpl();", "type": "TestresourceInterface", "var_name": "service" } ], "file": "jaxrs/src/test/java/...
{ "body": "@Test\n public void shouldSupportUuidAsHeader() {\n UUID uuid = UUID.randomUUID();\n assertThat(body(JaxRsTestUtil.getWithHeaders(service,\n \"/test/acceptsUuidHeader\",\n new HashMap<String, List<String>>() {\n {\n put(\"id\", asList...
{ "fields": [ { "declarator": "REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class))", "modifier": "private static final", "original_string": "private static final RequestLogger REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class));", "...
{ "body": "@Override\n public String toString() {\n return format(\"%1$s\\t%2$s (%3$s.%4$s)\",\n meta.getHttpMethod(),\n meta.getFullPath(),\n method.getDeclaringClass().getName(),\n method.getName());\n }", "class_method_signature": "JaxRsResource.toString()...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_35
{ "fields": [ { "declarator": "DESERIALIZER = new LocalDateDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<LocalDate> DESERIALIZER = new LocalDateDeserializer();", "type": "Deserializer<LocalDate>", "var_name": "DESERIALIZER"...
{ "body": "@Test\n public void shouldDeserializeNull() throws DeserializerException {\n LocalDate deserialized = DESERIALIZER.deserialize(null);\n assertThat(deserialized).isNull();\n }", "class_method_signature": "LocalDateDeserializerTest.shouldDeserializeNull()", "constructor": false, "fu...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\")", "modifier": "private static final", "original_string": "private static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\");", "type": "TimeZone", "var_name": "DEF...
{ "body": "@Override\n public LocalDate deserialize(String value) throws DeserializerException {\n if (value == null || value.length() == 0) {\n return null;\n }\n\n try {\n return LocalDate.parse(value);\n } catch (DateTimeParseException e) {\n LOG.warn...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_23
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/JaxRsMetaTest.java", "identifier": "JaxRsMetaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldFindJaxRsClassFromImplementation() {\n Optional<Class<?>> jaxRsClass = JaxRsMeta.getJaxRsClass(ResourceImplementingInterface.class);\n assertThat(jaxRsClass.isPresent()).isTrue();\n assertThat(jaxRsClass.get()).isEqualTo(ResourceInterface.class);\n }", ...
{ "fields": [ { "declarator": "method = null", "modifier": "private", "original_string": "private HttpMethod method = null;", "type": "HttpMethod", "var_name": "method" }, { "declarator": "methodPath = null", "modifier": "private", "original_string":...
{ "body": "public static Optional<Class<?>> getJaxRsClass(Class<?> cls) {\n if (!cls.isInterface()) {\n if (cls.getAnnotation(Path.class) != null) {\n return Optional.of(cls);\n }\n\n for (Class<?> iface : cls.getInterfaces()) {\n if (iface.getAnno...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_74
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldFindSizeMethod() {\n Getter size = ReflectionUtil.getGetter(List.class, \"size\");\n assertThat(size).isNotNull();\n }", "class_method_signature": "ReflectionUtilTest.shouldFindSizeMethod()", "constructor": false, "full_signature": "@Test public void shou...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "static Getter getGetter(Class<?> cls, String propertyName) {\n return getGetter(cls, cls, propertyName);\n }", "class_method_signature": "ReflectionUtil.getGetter(Class<?> cls, String propertyName)", "constructor": false, "full_signature": "static Getter getGetter(Class<?> cls, String prope...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_140
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldSerializeList() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n assertThat(client.serialize(new Long[]{})).isEqualTo(\"\");\n assertThat(client.serialize(new Long[]{5L, 78L, 1005L})).isEqualTo(\"5,78,1005\");\...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String serialize(Object value) {\n if (value instanceof Date) {\n return String.valueOf(((Date)value).getTime());\n }\n if (value.getClass().isArray()) {\n value = asList((Object[])value);\n }\n if (value instanceof List) {\n Str...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_5
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldThrowInvalidJsonException() {\n Function<String, ImmutableEntity> deserializer = deserializerFactory.createDeserializer(ImmutableEntity.class);\n\n try {\n deserializer.apply(\"not real json\");\n fail(\"Expected exception, but none was throw...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<String, T> createDeserializer(TypeReference<T> typeReference) {\n return createDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createDeserializer(TypeReference<T> typeReference)", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_58
{ "fields": [ { "declarator": "DESERIALIZER = new ListDeserializer((str) -> str)", "modifier": "private final static", "original_string": "private final static Deserializer<List<String>> DESERIALIZER = new ListDeserializer((str) -> str);", "type": "Deserializer<List<String>>", "var_n...
{ "body": "@Test\n public void shouldDeserializeNull() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(null)).isNull();\n }", "class_method_signature": "ListDeserializerTest.shouldDeserializeNull()", "constructor": false, "full_signature": "@Test public void shouldDeserializeNu...
{ "fields": [ { "declarator": "inner", "modifier": "private final", "original_string": "private final Deserializer<T> inner;", "type": "Deserializer<T>", "var_name": "inner" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/ListDeserialize...
{ "body": "@Override\n public List<T> deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n\n if (value.isEmpty()) {\n return Collections.emptyList();\n }\n\n String[] rawValues = value.split(\",\");\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_117
{ "fields": [ { "declarator": "pagingOutput", "modifier": "@Mock\n private", "original_string": "@Mock\n private PagingOutput pagingOutput;", "type": "PagingOutput", "var_name": "pagingOutput" }, { "declarator": "dbStatementFactory", "modifier": "@Mock\n ...
{ "body": "@Test\n public void shouldReleaseSchedulerWorkers() {\n Observable<Object> stmt = statementFactory.create(new Object[0], mockDb.getConnectionProvider());\n stmt.toBlocking().single();\n verify(scheduler, times(1)).createWorker();\n verify(worker).unsubscribe();\n }", "cl...
{ "fields": [ { "declarator": "RECORD_BUFFER_SIZE = 100000", "modifier": "private static final", "original_string": "private static final int RECORD_BUFFER_SIZE = 100000;", "type": "int", "var_name": "RECORD_BUFFER_SIZE" }, { "declarator": "LOG ...
{ "body": "public Observable<Object> create(Object[] args, ConnectionProvider connectionProvider) {\n AtomicReference<TransactionStatement> transactionHolder = new AtomicReference<>();\n\n Observable<Object> result = Observable.unsafeCreate(subscription -> {\n try {\n Statement...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_101
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/DebugUtilTest.java", "identifier": "DebugUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsIdePresent() throws MalformedURLException {\n ClassLoader classLoaderWithIdeaDebugger = Mockito.mock(ClassLoader.class);\n when(classLoaderWithIdeaDebugger.getResource(eq(\"com/intellij\")))\n .thenReturn(new URL(\"jar:file:/path/to/debugger-agent-s...
{ "fields": [ { "declarator": "IS_DEBUG = isIdePresent(DebugUtil.class.getClassLoader()) || isMavenDebug()", "modifier": "public static final", "original_string": "public static final boolean IS_DEBUG = isIdePresent(DebugUtil.class.getClassLoader()) || isMavenDebug();", "type": "boolean", ...
{ "body": "static boolean isIdePresent(ClassLoader classLoader) {\n return classLoader.getResource(\"com/intellij\") != null;\n }", "class_method_signature": "DebugUtil.isIdePresent(ClassLoader classLoader)", "constructor": false, "full_signature": "static boolean isIdePresent(ClassLoader classLoader)...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_19
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/RequestLoggerTest.java", "identifier": "RequestLoggerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotRedactAuthorizationValue() {\n Map.Entry<String,String> header = new AbstractMap.SimpleEntry<>(\"OtherHeader\", \"notasecret\");\n String result = RequestLogger.getHeaderValueOrRedact(header);\n assertEquals(result, \"notasecret\");\n }", "class_met...
{ "fields": [ { "declarator": "logger", "modifier": "private final", "original_string": "private final Logger logger;", "type": "Logger", "var_name": "logger" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/RequestLogger.java", "identifier": "RequestLogger...
{ "body": "public static String getHeaderValueOrRedact(Map.Entry<String, String> header) {\n if (header == null) {\n return null;\n } else if (\"Authorization\".equalsIgnoreCase(header.getKey())) {\n return \"REDACTED\";\n }\n return header.getValue();\n }", "cla...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_156
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldSendFormParamsAsBodyWithCorrectContentType() {\n AtomicReference<HttpServerRequest> recordedRequest = new AtomicReference<>();\n AtomicReference<String> recordedRequestBody = new AtomicReference<>();\n\n DisposableServer server = Htt...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_121
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/db/deserializing/DeserializerUtilTest.java", "identifier": "DeserializerUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldLogWarnIfNoPropertyDeserializerWasFound() throws SQLException, NoSuchFieldException, IllegalAccessException {\n SimpleResultSet resultSet = new SimpleResultSet();\n resultSet.addColumn(\"test_a\", Types.VARCHAR, 255, 0);\n\n Appender mockAppender = createMo...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(DeserializerUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(DeserializerUtil.class);", "...
{ "body": "static <I,T> Map<String[], T> createPropertyDeserializers(Class<I> cls, ResultSetMetaData metaData,\n BiFunction<PropertyResolver<I,?>, Deserializer, T> deserializerFactory\n ) throws SQLException {\n Map<String[], T> propertyDeserializers = new LinkedHashMap<>();\n\n String[] colum...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_81
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Getter<GenericFieldSubclass, Integer> value;", "type": "Getter<GenericFieldSubclass, Integer>", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private"...
{ "body": "@Test\n public void shouldGetValue() throws Exception {\n assertThat(value.invoke(new GenericFieldSubclass(5))).isEqualTo(5);\n assertThat(genericSuperKey.invoke(new GenericFieldSubclass(5))).isEqualTo(\"5\");\n assertThat(genericSuperValue.invoke(new GenericFieldSubclass(5))).isEqu...
{ "fields": [ { "declarator": "fieldLambda", "modifier": "private final", "original_string": "private final Function<I,T> fieldLambda;", "type": "Function<I,T>", "var_name": "fieldLambda" }, { "declarator": "returnType", "modifier": "private final", "origina...
{ "body": "@Override\n public T invoke(I instance) {\n return fieldLambda.apply(instance);\n }", "class_method_signature": "FieldGetter.invoke(I instance)", "constructor": false, "full_signature": "@Override public T invoke(I instance)", "identifier": "invoke", "invocations": [ "apply" ],...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_39
{ "fields": [ { "declarator": "DESERIALIZER = new UUIDDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<UUID> DESERIALIZER = new UUIDDeserializer();", "type": "Deserializer<UUID>", "var_name": "DESERIALIZER" } ], "file"...
{ "body": "@Test\n public void shouldThrowDeserializerExceptionForUnparsableStrings() {\n try {\n DESERIALIZER.deserialize(\"not a recognized value\");\n fail(\"Expected exception, but none was thrown\");\n } catch (Exception exception) {\n assertThat(exception).isIns...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/UUIDDeserializer.java", "identifier": "UUIDDeserializer", "interfaces": "implements Deserializer<UUID>", "methods": [ { "class_method_signature": "UUIDDeserializer.deserialize(String value)", "con...
{ "body": "@Override\n public UUID deserialize(String value) throws DeserializerException {\n try {\n return value == null || value.equals(\"\") ? null : UUID.fromString(value);\n } catch (Exception e) {\n throw new DeserializerException(\"invalid.uuid\");\n }\n }", ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_160
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldErrorOnUntrustedHost() throws URISyntaxException, CertificateException {\n SelfSignedCertificate cert = new SelfSignedCertificate();\n SslContextBuilder serverOptions = SslContextBuilder.forServer(cert.certificate(), cert.privateKey());\n Dispo...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_137
{ "fields": [ { "declarator": "serializers", "modifier": "private", "original_string": "private RequestParameterSerializers serializers;", "type": "RequestParameterSerializers", "var_name": "serializers" } ], "file": "client/src/test/java/se/fortnox/reactivewizard/client/Requ...
{ "body": "@Test\n public void shouldProvideSerializerByClass() {\n assertThat(serializers.getSerializer(Foo.class)).isInstanceOf(Foo.class);\n assertThat(serializers.getSerializer(Bar.class)).isInstanceOf(Bar.class);\n }", "class_method_signature": "RequestParameterSerializersTest.shouldProvide...
{ "fields": [ { "declarator": "serializers", "modifier": "private final", "original_string": "private final Map<Class, RequestParameterSerializer> serializers;", "type": "Map<Class, RequestParameterSerializer>", "var_name": "serializers" } ], "file": "client/src/main/java/se/...
{ "body": "public RequestParameterSerializer<?> getSerializer(Class<?> type) {\n return serializers.get(type);\n }", "class_method_signature": "RequestParameterSerializers.getSerializer(Class<?> type)", "constructor": false, "full_signature": "public RequestParameterSerializer<?> getSerializer(Class<?...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_97
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void oneItemShouldReturnOneItem() {\n List<Foo> expected = Collections.singletonList(new Foo());\n\n Foo actual = RxUtils.singleOrEmpty(just(expected)).toBlocking().single();\n\n assertThat(actual).isEqualTo(expected.get(0));\n }", "class_method_signature": "RxUt...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {\n return collectionObservable.toList().concatMap(lists -> {\n if (lists.size() > 1) {\n return Observable.error(new IllegalArgumentException(\"Observable contains more ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_78
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldCreateSetterLambda() {\n Parent parent = new Parent();\n\n BiConsumer<Parent, Integer> setOnParent = ReflectionUtil.<Parent,Integer>setter(Parent.class, \"i\").get();\n setOnParent.accept(parent, 2);\n assertThat(parent.getI()).isEqualTo(2);\n\n\n ...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "public static <I,T> Optional<BiConsumer<I,T>> setter(Class<I> instanceCls, String propertyPath) {\n Optional<PropertyResolver> propertyResolver = ReflectionUtil.getPropertyResolver(instanceCls, propertyPath.split(\"\\\\.\"));\n return propertyResolver.map(PropertyResolver::setter);\n\n }",...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_9
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldSerializeAndDeserializeImmutableObjectsByTypeReference() {\n Function<ImmutableEntity, byte[]> serializer = serializerFactory.createByteSerializer(immutableEntityTypeReference);\n byte[] json = serializer.apply(immutableEntity);\n\n Function<byte[], Immutab...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<byte[], T> createByteDeserializer(TypeReference<T> typeReference) {\n return createByteDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createByteDeserializer(TypeReference<T> typeReference)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_54
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanNotNullDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanNotNullDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIA...
{ "body": "@Test\n public void shouldThrowExceptionForNull() throws DeserializerException {\n try {\n DESERIALIZER.deserialize(null);\n fail(\"Expected exception, but none was thrown\");\n } catch (Exception exception) {\n assertThat(exception).isInstanceOf(Deserializ...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanNotNullDeserializer.java", "identifier": "BooleanNotNullDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanNotNullDeserializer.deser...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n if (value == null) {\n throw new DeserializerException(\"invalid.boolean\");\n }\n return Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanNotNullDeserializer....
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_42
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIALIZER" } ...
{ "body": "@Test\n public void shouldDeserializeUnknownValuesToFalse() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"anything\")).isEqualTo(false);\n }", "class_method_signature": "BooleanDeserializerTest.shouldDeserializeUnknownValuesToFalse()", "constructor": false, "full...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanDeserializer.java", "identifier": "BooleanDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanDeserializer.deserialize(String value)"...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n return (value == null) ? null : Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanDeserializer.deserialize(String value)", "constructor": false, "full_signature": "@Override public ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_15
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldDeserializeFromType() throws NoSuchMethodException {\n Method method = this.getClass().getDeclaredMethod(\"methodReturningListOfString\");\n Type type = method.getGenericReturnType();\n Function<String, List<String>> serializeList = deserializerFactory.crea...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<String, T> createDeserializer(TypeReference<T> typeReference) {\n return createDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createDeserializer(TypeReference<T> typeReference)", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_122
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/db/deserializing/DeserializerUtilTest.java", "identifier": "DeserializerUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotWarnForFoundProperties() throws SQLException, NoSuchFieldException, IllegalAccessException {\n SimpleResultSet resultSet = new SimpleResultSet();\n resultSet.addColumn(\"test_b\", Types.VARCHAR, 255, 0);\n\n Appender mockAppender = createMockedLogAppende...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(DeserializerUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(DeserializerUtil.class);", "...
{ "body": "static <I,T> Map<String[], T> createPropertyDeserializers(Class<I> cls, ResultSetMetaData metaData,\n BiFunction<PropertyResolver<I,?>, Deserializer, T> deserializerFactory\n ) throws SQLException {\n Map<String[], T> propertyDeserializers = new LinkedHashMap<>();\n\n String[] colum...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_82
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Getter<GenericFieldSubclass, Integer> value;", "type": "Getter<GenericFieldSubclass, Integer>", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private"...
{ "body": "@Test\n public void shouldSupportLambdaGetter() {\n Function<GenericFieldSubclass, Integer> getter = value.getterFunction();\n assertThat(getter.apply(new GenericFieldSubclass(5))).isEqualTo(5);\n\n }", "class_method_signature": "FieldGetterTest.shouldSupportLambdaGetter()", "constr...
{ "fields": [ { "declarator": "fieldLambda", "modifier": "private final", "original_string": "private final Function<I,T> fieldLambda;", "type": "Function<I,T>", "var_name": "fieldLambda" }, { "declarator": "returnType", "modifier": "private final", "origina...
{ "body": "@Override\n public Function<I,T> getterFunction() {\n return fieldLambda;\n }", "class_method_signature": "FieldGetter.getterFunction()", "constructor": false, "full_signature": "@Override public Function<I,T> getterFunction()", "identifier": "getterFunction", "invocations": [], "m...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_175
{ "fields": [ { "declarator": "compositeRequestHandler", "modifier": "private", "original_string": "private CompositeRequestHandler compositeRequestHandler;", "type": "CompositeRequestHandler", "var_name": "compositeRequestHandler" }, { "declarator": "requestHandlers = ...
{ "body": "@Test\n public void exceptionHandlerShallBeInvokedWhenNullIsReturnedByRequestHandler() {\n\n when(response.status()).thenReturn(HttpResponseStatus.OK);\n requestHandlers.add((request, response) -> null);\n\n Flux.from(compositeRequestHandler.apply(request, response)).count().block()...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(CompositeRequestHandler.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(CompositeRequestHandler.class);", "type": "Logger", "var_name": "log" },...
{ "body": "@Override\n public Publisher<Void> apply(HttpServerRequest request, HttpServerResponse response) {\n final long requestStartTime = System.currentTimeMillis();\n try {\n for (RequestHandler handler : handlers) {\n Publisher<Void> result = handler.apply(request, res...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_163
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldSupportSendingXml() {\n AtomicReference<HttpServerRequest> recordedRequest = new AtomicReference<>();\n AtomicReference<String> recordedRequestBody = new AtomicReference<>();\n\n DisposableServer server = HttpServer.create().port(0)....
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_134
{ "fields": [], "file": "jaxrs-api/src/test/java/se/fortnox/reactivewizard/jaxrs/WebExceptionTest.java", "identifier": "WebExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldSetErrorFromStatusWhenFieldErrorsAreEmpty() {\n WebException webException = new WebException(BAD_REQUEST, new FieldError[0]);\n assertThat(webException.getError()).isEqualTo(\"badrequest\");\n }", "class_method_signature": "WebExceptionTest.shouldSetErrorFrom...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "error", "modifier": "private", "original_string": "private String error;", ...
{ "body": "public String getError() {\n return error;\n }", "class_method_signature": "WebException.getError()", "constructor": false, "full_signature": "public String getError()", "identifier": "getError", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_94
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = RuntimeException.class)\n public void testException() {\n empty()\n .switchIfEmpty(RxUtils.exception(RuntimeException::new))\n .toBlocking()\n .first();\n }", "class_method_signature": "RxUtilsTest.testException()", "constructor": false, ...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> exception(Supplier<Exception> supplier) {\n return defer(() -> error(supplier.get()));\n }", "class_method_signature": "RxUtils.exception(Supplier<Exception> supplier)", "constructor": false, "full_signature": "public static Observable<T> exception(Supplier<E...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_118
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/db/query/parts/ParamQueryPartTest.java", "identifier": "ParamQueryPartTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldIncludePropertiesAndTypeOnSubPathError() throws SQLException {\n ParamQueryPart paramQueryPart = new ParamQueryPart(0,\n ReflectionUtil.getPropertyResolver(Foo.class).orElseThrow(IllegalArgumentException::new));\n\n try {\n paramQueryPart.sub...
{ "fields": [ { "declarator": "JSON_SERIALIZER_FACTORY = new JsonSerializerFactory()", "modifier": "private static final", "original_string": "private static final JsonSerializerFactory JSON_SERIALIZER_FACTORY = new JsonSerializerFactory();", "type": "JsonSerializerFactory", "var_nam...
{ "body": "@Override\n public DynamicQueryPart subPath(String[] subPath) throws SQLException {\n Optional<PropertyResolver> propertyResolver = argResolver.subPath(subPath);\n if (!propertyResolver.isPresent()) {\n throw new RuntimeException(String.format(\"Properties %s cannot be found in ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_57
{ "fields": [ { "declarator": "DESERIALIZER = new ListDeserializer((str) -> str)", "modifier": "private final static", "original_string": "private final static Deserializer<List<String>> DESERIALIZER = new ListDeserializer((str) -> str);", "type": "Deserializer<List<String>>", "var_n...
{ "body": "@Test\n public void shouldHandleDeserializationErrorsForEntries() {\n Deserializer<Boolean[]> longDeserializer = new ArrayDeserializer(new LongDeserializer(), Long.class);\n try {\n longDeserializer.deserialize(\"5,notlong,5\");\n fail(\"Expected exception, but none w...
{ "fields": [ { "declarator": "inner", "modifier": "private final", "original_string": "private final Deserializer<T> inner;", "type": "Deserializer<T>", "var_name": "inner" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/ListDeserialize...
{ "body": "@Override\n public List<T> deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n\n if (value.isEmpty()) {\n return Collections.emptyList();\n }\n\n String[] rawValues = value.split(\",\");\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_41
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIALIZER" } ...
{ "body": "@Test\n public void shouldDeserializeFalse() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"false\")).isEqualTo(false);\n assertThat(DESERIALIZER.deserialize(\"FALSE\")).isEqualTo(false);\n assertThat(DESERIALIZER.deserialize(\"False\")).isEqualTo(false);\n ...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanDeserializer.java", "identifier": "BooleanDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanDeserializer.deserialize(String value)"...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n return (value == null) ? null : Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanDeserializer.deserialize(String value)", "constructor": false, "full_signature": "@Override public ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_159
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldExecutePreRequestHooks() throws URISyntaxException {\n DisposableServer server = HttpServer.create().port(0).handle((request, response) -> {\n response.status(HttpResponseStatus.OK);\n return response.sendString(Mono.just(\"\\\"hi\\\"\"));\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_16
{ "fields": [ { "declarator": "handler", "modifier": "private", "original_string": "private JaxRsRequestHandler handler;", "type": "JaxRsRequestHandler", "var_name": "handler" }, { "declarator": "interceptor", "modifier": "private", "original_string": "priva...
{ "body": "@Test\n public void shouldInterceptResourceCall() {\n MockHttpServerRequest request = new MockHttpServerRequest(\"/\");\n MockHttpServerResponse response = new MockHttpServerResponse();\n Publisher<Void> result = handler.apply(request, response);\n\n assertThat(interceptor.pr...
{ "fields": [ { "declarator": "resources", "modifier": "private final", "original_string": "private final JaxRsResources resources;", "type": "JaxRsResources", "var_name": "resources" }, { "declarator": "exceptionHandler", "modifier": "private final", "ori...
{ "body": "@Override\n public Publisher<Void> apply(HttpServerRequest request, HttpServerResponse response) {\n JaxRsRequest jaxRsRequest = new JaxRsRequest(request, collector);\n JaxRsResource<?> resource = resources.findResource(jaxRsRequest);\n\n if (resource == null) {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_61
{ "fields": [ { "declarator": "service = new TestresourceImpl()", "modifier": "private final", "original_string": "private final TestresourceInterface service = new TestresourceImpl();", "type": "TestresourceInterface", "var_name": "service" } ], "file": "jaxrs/src/test/java/...
{ "body": "@Test\n public void shouldSupportUuidAsQueryParameter() {\n UUID uuid = UUID.randomUUID();\n assertThat(body(\n get(service, \"/test/acceptsUuid?id=\" + uuid.toString())))\n .isEqualTo(\"\\\"Id: \" + uuid + \"\\\"\");\n }", "class_method_signature": "JaxRsResourc...
{ "fields": [ { "declarator": "REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class))", "modifier": "private static final", "original_string": "private static final RequestLogger REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class));", "...
{ "body": "@Override\n public String toString() {\n return format(\"%1$s\\t%2$s (%3$s.%4$s)\",\n meta.getHttpMethod(),\n meta.getFullPath(),\n method.getDeclaringClass().getName(),\n method.getName());\n }", "class_method_signature": "JaxRsResource.toString()...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_36
{ "fields": [ { "declarator": "DESERIALIZER = new LocalDateDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<LocalDate> DESERIALIZER = new LocalDateDeserializer();", "type": "Deserializer<LocalDate>", "var_name": "DESERIALIZER"...
{ "body": "@Test\n public void shouldThrowDeserializerExceptionForBadDates() {\n try {\n DESERIALIZER.deserialize(\"not a date\");\n fail(\"Expected exception, but none was thrown\");\n } catch (Exception exception) {\n assertThat(exception).isInstanceOf(Deserializer...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\")", "modifier": "private static final", "original_string": "private static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone(\"Europe/Stockholm\");", "type": "TimeZone", "var_name": "DEF...
{ "body": "@Override\n public LocalDate deserialize(String value) throws DeserializerException {\n if (value == null || value.length() == 0) {\n return null;\n }\n\n try {\n return LocalDate.parse(value);\n } catch (DateTimeParseException e) {\n LOG.warn...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_20
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/RequestLoggerTest.java", "identifier": "RequestLoggerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldRedactAuthorizationValues() {\n Map<String,String> headers = new HashMap<>();\n headers.put(\"Authorization\", \"secret\");\n headers.put(\"OtherHeader\", \"notasecret\");\n\n Set<Map.Entry<String, String>> result = RequestLogger.getHeaderValuesOrRed...
{ "fields": [ { "declarator": "logger", "modifier": "private final", "original_string": "private final Logger logger;", "type": "Logger", "var_name": "logger" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/RequestLogger.java", "identifier": "RequestLogger...
{ "body": "public static Set<Map.Entry<String, String>> getHeaderValuesOrRedact(Map<String, String> headers) {\n if (headers == null) {\n return Collections.emptySet();\n }\n return headers\n .entrySet()\n .stream()\n .collect(Collectors.toMap(\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_77
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldCreateGetterLambda() {\n Parent parent = new Parent();\n parent.setI(3);\n\n Function<Parent, Integer> getFromParent = ReflectionUtil.<Parent,Integer>getter(Parent.class, \"i\").get();\n assertThat(getFromParent.apply(parent)).isEqualTo(3);\n\n\n ...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "public static <I,T> Optional<Function<I,T>> getter(Class<I> instanceCls, String propertyPath) {\n Optional<PropertyResolver> propertyResolver = ReflectionUtil.getPropertyResolver(instanceCls, propertyPath.split(\"\\\\.\"));\n return propertyResolver.map(PropertyResolver::getter);\n }", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_98
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void severalItemsShouldNotifyException() {\n List<Foo> foos = Arrays.asList(new Foo(), new Foo());\n\n RxUtils.singleOrEmpty(just(foos)).toBlocking().subscribe();\n }", "class_method_signature": "RxUtilsTest.severalItemsShouldN...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {\n return collectionObservable.toList().concatMap(lists -> {\n if (lists.size() > 1) {\n return Observable.error(new IllegalArgumentException(\"Observable contains more ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_138
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldReportUnhealthyWhenConnectionCannotBeAquiredBeforeTimeout() throws URISyntaxException {\n\n DisposableServer server = HttpServer.create().port(0)\n .handle((request, response) -> Flux.defer(() -> {\n response.status(HttpResponseStatus.OK);\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_6
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldThrowInvalidJsonExceptionUsingByteArayDeserializer() {\n Function<byte[], ImmutableEntity> deserializer = deserializerFactory.createByteDeserializer(ImmutableEntity.class);\n\n try {\n deserializer.apply(\"not real json\".getBytes());\n fail(...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<byte[], T> createByteDeserializer(TypeReference<T> typeReference) {\n return createByteDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createByteDeserializer(TypeReference<T> typeReference)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_143
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldEncodePathWithoutNullValues() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n Method method = TestResource.class.getMethod(\"withPathAndQueryParam\", String.class, String.class);\n String path = clie...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String getPath(Method method, Object[] arguments, JaxRsMeta meta) {\n String path = meta.getFullPath();\n\n StringBuilder query = null;\n Class<?>[] types = method.getParameterTypes();\n List<Object> args = new ArrayList<>(asList(arguments));\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_114
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/CompoundKeyTest.java", "identifier": "CompoundKeyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldCompareNullValues() {\n CompoundKey key1 = new CompoundKey(null, null);\n CompoundKey key2 = new CompoundKey(null, null, null);\n\n assertThat(key1).isNotEqualTo(key2);\n assertThat(key1.hashCode()).isNotEqualTo(key2.hashCode());\n }", "class_me...
{ "fields": [ { "declarator": "keys", "modifier": "private", "original_string": "private Object[] keys;", "type": "Object[]", "var_name": "keys" } ], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/CompoundKey.java", "identifier": "CompoundKey", "interfaces": ...
{ "body": "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n for (Object k : keys) {\n result = result * prime + (k == null ? 0 : k.hashCode());\n }\n return result;\n }", "class_method_signature": "CompoundKey.hashCode()", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_102
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/DebugUtilTest.java", "identifier": "DebugUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsMavenDebug() {\n String debugPropName = \"maven.surefire.debug\";\n boolean originalSurefireDebugProp = Boolean.getBoolean(debugPropName);\n System.setProperty(debugPropName, \"true\");\n\n assertThat(DebugUtil.isMavenDebug()).isTrue();\n\n //...
{ "fields": [ { "declarator": "IS_DEBUG = isIdePresent(DebugUtil.class.getClassLoader()) || isMavenDebug()", "modifier": "public static final", "original_string": "public static final boolean IS_DEBUG = isIdePresent(DebugUtil.class.getClassLoader()) || isMavenDebug();", "type": "boolean", ...
{ "body": "static boolean isMavenDebug() {\n return Boolean.getBoolean(\"maven.surefire.debug\");\n }", "class_method_signature": "DebugUtil.isMavenDebug()", "constructor": false, "full_signature": "static boolean isMavenDebug()", "identifier": "isMavenDebug", "invocations": [ "getBoolean" ]...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_155
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldHandleMultipleChunks() {\n DisposableServer server = HttpServer.create().port(0).handle((request, response) -> {\n response.status(HttpResponseStatus.OK);\n return response.sendString(just(\"\\\"he\")\n .concatWith(defer(() -> just(\"...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_154
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldHandleLongerRequestsThan10SecondsWhenRequested() {\n DisposableServer server = startSlowServer(HttpResponseStatus.NOT_FOUND, 20000);\n\n TestResource resource = getHttpProxy(server.port(), 1, 30000);\n HttpClient.setTimeout(resource, 15000, ChronoUnit.MILLI...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "public static void setTimeout(Object proxy, int timeout, ChronoUnit timeoutUnit) {\n if (Proxy.isProxyClass(proxy.getClass())) {\n Object handler = Proxy.getInvocationHandler(proxy);\n if (handler instanceof HttpClient) {\n ((HttpClient)handler).setTimeout(timeou...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_103
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Setter value;", "type": "Setter", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private", "original_string": "private Setter longObservable;", ...
{ "body": "@Test\n public void shouldSetFinalField() throws Exception {\n GenericFieldSubclass foo = new GenericFieldSubclass(1);\n value.invoke(foo, 9);\n assertThat(foo.value).isEqualTo(9);\n\n genericSuperKey.invoke(foo, \"9\");\n assertThat(foo.superKey).isEqualTo(\"9\");\n\n...
{ "fields": [ { "declarator": "field", "modifier": "private final", "original_string": "private final Field field;", "type": "Field", "var_name": "field" }, { "declarator": "setter", "modifier": "private final", "original_string": "private final Bi...
{ "body": "@Override\n public void invoke(I instance, T value) throws IllegalAccessException {\n field.set(instance, value);\n }", "class_method_signature": "FieldSetter.invoke(I instance, T value)", "constructor": false, "full_signature": "@Override public void invoke(I instance, T value)", "ide...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_115
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/util/CamelSnakeConverterTest.java", "identifier": "CamelSnakeConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldConvertToCamelCase() {\n assertThat(CamelSnakeConverter.snakeToCamel(\"AAA\")).isEqualTo(\"aaa\");\n assertThat(CamelSnakeConverter.snakeToCamel(\"AAA_AAA_AAA\")).isEqualTo(\"aaaAaaAaa\");\n assertThat(CamelSnakeConverter.snakeToCamel(\"a_a\")).isEqualTo(\"...
{ "fields": [ { "declarator": "camelRegex = Pattern.compile(\"([a-z])([A-Z]+)\")", "modifier": "private static final", "original_string": "private static final Pattern camelRegex = Pattern.compile(\"([a-z])([A-Z]+)\");", "type": "Pattern", "var_name": "camelRegex" }, ...
{ "body": "public static String snakeToCamel(String snakeString) {\n String lowerCaseSnakeString = snakeString.toLowerCase();\n StringBuilder camel = new StringBuilder();\n boolean nextUpper = false;\n for (char c : lowerCaseSnakeString.toCharArray())...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_7
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldDeserializeNullToNull() {\n Function<String, ImmutableEntity> deserializer = deserializerFactory.createDeserializer(ImmutableEntity.class);\n\n ImmutableEntity result = deserializer.apply(null);\n\n assertThat(result).isNull();\n }", "class_method_sign...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<String, T> createDeserializer(TypeReference<T> typeReference) {\n return createDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createDeserializer(TypeReference<T> typeReference)", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_142
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldEncodeWithMultipleQueryParams() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n Method method = TestResource.class.getMethod(\"withMultipleQueryParam\", String.class, String.class);\n String path = c...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String getPath(Method method, Object[] arguments, JaxRsMeta meta) {\n String path = meta.getFullPath();\n\n StringBuilder query = null;\n Class<?>[] types = method.getParameterTypes();\n List<Object> args = new ArrayList<>(asList(arguments));\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_139
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldSerializeDate() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n assertThat(client.serialize(new Date(1474889891615L))).isEqualTo(\"1474889891615\");\n }", "class_method_signature": "HttpClientTest.shouldSerializ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String serialize(Object value) {\n if (value instanceof Date) {\n return String.valueOf(((Date)value).getTime());\n }\n if (value.getClass().isArray()) {\n value = asList((Object[])value);\n }\n if (value instanceof List) {\n Str...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_76
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/ReflectionUtilTest.java", "identifier": "ReflectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldCreateInstantiator() {\n assertThat(ReflectionUtil.instantiator(Parent.class).get()).isInstanceOf(Parent.class);\n }", "class_method_signature": "ReflectionUtilTest.shouldCreateInstantiator()", "constructor": false, "full_signature": "@Test public void shouldCre...
{ "fields": [ { "declarator": "CGLIB_CLASS_SEPARATOR = \"$$\"", "modifier": "private static final", "original_string": "private static final String CGLIB_CLASS_SEPARATOR = \"$$\";", "type": "String", "var_name": "CGLIB_CLASS_SEPARATOR" } ], "file": "utils/src/main/java/se/for...
{ "body": "public static <T> Supplier<T> instantiator(Class<T> cls) {\n try {\n Constructor<?> constructor = Stream.of(cls.getDeclaredConstructors())\n .filter(c -> c.getParameterCount() == 0)\n .findFirst()\n .orElseThrow(NoSuchMethodExceptio...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_99
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void severalCollectionsShouldNotifyException() {\n List<Foo> foos =Arrays.asList(new Foo(), new Foo());\n List<Foo> fi =Arrays.asList(new Foo(), new Foo());\n\n RxUtils.singleOrEmpty(just(foos, fi)).toBlocking().subscribe();\...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {\n return collectionObservable.toList().concatMap(lists -> {\n if (lists.size() > 1) {\n return Observable.error(new IllegalArgumentException(\"Observable contains more ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_21
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/RequestLoggerTest.java", "identifier": "RequestLoggerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnNull_getHeaderValuesOrRedact() {\n Set<Map.Entry<String, String>> result = RequestLogger.getHeaderValuesOrRedact(null);\n assertTrue(CollectionUtils.isEqualCollection(result, Collections.emptySet()));\n }", "class_method_signature": "RequestLoggerTest.s...
{ "fields": [ { "declarator": "logger", "modifier": "private final", "original_string": "private final Logger logger;", "type": "Logger", "var_name": "logger" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/RequestLogger.java", "identifier": "RequestLogger...
{ "body": "public static Set<Map.Entry<String, String>> getHeaderValuesOrRedact(Map<String, String> headers) {\n if (headers == null) {\n return Collections.emptySet();\n }\n return headers\n .entrySet()\n .stream()\n .collect(Collectors.toMap(\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_37
{ "fields": [ { "declarator": "DESERIALIZER = new UUIDDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<UUID> DESERIALIZER = new UUIDDeserializer();", "type": "Deserializer<UUID>", "var_name": "DESERIALIZER" } ], "file"...
{ "body": "@Test\n public void shouldDeserialize() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"b0b895d4-3be8-11e8-b467-0ed5f89f718b\").toString()).isEqualTo(\"b0b895d4-3be8-11e8-b467-0ed5f89f718b\");\n }", "class_method_signature": "UUIDDeserializerTest.shouldDeserialize()", ...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/UUIDDeserializer.java", "identifier": "UUIDDeserializer", "interfaces": "implements Deserializer<UUID>", "methods": [ { "class_method_signature": "UUIDDeserializer.deserialize(String value)", "con...
{ "body": "@Override\n public UUID deserialize(String value) throws DeserializerException {\n try {\n return value == null || value.equals(\"\") ? null : UUID.fromString(value);\n } catch (Exception e) {\n throw new DeserializerException(\"invalid.uuid\");\n }\n }", ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_60
{ "fields": [ { "declarator": "service = new TestresourceImpl()", "modifier": "private final", "original_string": "private final TestresourceInterface service = new TestresourceImpl();", "type": "TestresourceInterface", "var_name": "service" } ], "file": "jaxrs/src/test/java/...
{ "body": "@Test\n public void shouldResolveCustomType() throws IllegalAccessException,\n IllegalArgumentException, InvocationTargetException, JsonProcessingException {\n\n MockHttpServerRequest req = new MockHttpServerRequest(\"/test/accepts/res?fid=5678\");\n req.cookies().put(\"fnox_5678\",...
{ "fields": [ { "declarator": "REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class))", "modifier": "private static final", "original_string": "private static final RequestLogger REQUEST_LOGGER = new RequestLogger(LoggerFactory.getLogger(JaxRsResource.class));", "...
{ "body": "protected Mono<JaxRsResult<T>> call(JaxRsRequest request) {\n return request.loadBody()\n .flatMap(this::resolveArgs)\n .map(this::call);\n }", "class_method_signature": "JaxRsResource.call(JaxRsRequest request)", "constructor": false, "full_signature": "protected Mono...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_17
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/JaxRsRequestTest.java", "identifier": "JaxRsRequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldFailWhenDecodingTooLargeBody() {\n String input = generateLargeString(6);\n HttpServerRequest serverReq = new MockHttpServerRequest(\"/\", HttpMethod.DELETE, input);\n JaxRsRequest req = new JaxRsRequest(serverReq, new ByteBufCollector(5...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(JaxRsResource.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(JaxRsResource.class);", "type": "Logger", "var_name": "LOG" }, { "declar...
{ "body": "public Mono<JaxRsRequest> loadBody() {\n HttpMethod httpMethod = req.method();\n if (POST.equals(httpMethod) || PUT.equals(httpMethod) || PATCH.equals(httpMethod) || DELETE.equals(httpMethod)) {\n return collector.collectBytes(req.receive()\n .doOnError(e -> LOG.erro...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_158
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldAllowBodyInPostPutDeletePatchCalls() {\n AtomicReference<HttpServerRequest> recordedRequest = new AtomicReference<>();\n AtomicReference<String> recordedRequestBody = new AtomicReference<>();\n\n DisposableServer server = HttpServer....
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> jaxRsInterface) {\n return (T)Proxy.newProxyInstance(jaxRsInterface.getClassLoader(), new Class[]{jaxRsInterface}, this);\n }", "class_method_signature": "HttpClient.create(Class<T> jaxRsInterface)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_40
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIALIZER" } ...
{ "body": "@Test\n public void shouldDeserializeTrue() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"true\")).isEqualTo(true);\n assertThat(DESERIALIZER.deserialize(\"TRUE\")).isEqualTo(true);\n assertThat(DESERIALIZER.deserialize(\"True\")).isEqualTo(true);\n }", ...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanDeserializer.java", "identifier": "BooleanDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanDeserializer.deserialize(String value)"...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n return (value == null) ? null : Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanDeserializer.deserialize(String value)", "constructor": false, "full_signature": "@Override public ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_56
{ "fields": [ { "declarator": "DESERIALIZER = new ListDeserializer((str) -> str)", "modifier": "private final static", "original_string": "private final static Deserializer<List<String>> DESERIALIZER = new ListDeserializer((str) -> str);", "type": "Deserializer<List<String>>", "var_n...
{ "body": "@Test\n public void shouldDeserializeEmptyLists() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"\")).hasSize(0);\n }", "class_method_signature": "ListDeserializerTest.shouldDeserializeEmptyLists()", "constructor": false, "full_signature": "@Test public void shoul...
{ "fields": [ { "declarator": "inner", "modifier": "private final", "original_string": "private final Deserializer<T> inner;", "type": "Deserializer<T>", "var_name": "inner" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/ListDeserialize...
{ "body": "@Override\n public List<T> deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n\n if (value.isEmpty()) {\n return Collections.emptyList();\n }\n\n String[] rawValues = value.split(\",\");\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_119
{ "fields": [], "file": "dao/src/test/java/se/fortnox/reactivewizard/db/deserializing/MutabilityDetectorTest.java", "identifier": "MutabilityDetectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsImmutable() {\n assertThat(MutabilityDetector.isImmutable(Immutable.class)).isTrue();\n assertThat(MutabilityDetector.isImmutable(Mutable.class)).isFalse();\n }", "class_method_signature": "MutabilityDetectorTest.testIsImmutable()", "constructor": false, ...
{ "fields": [], "file": "dao/src/main/java/se/fortnox/reactivewizard/db/deserializing/MutabilityDetector.java", "identifier": "MutabilityDetector", "interfaces": "", "methods": [ { "class_method_signature": "MutabilityDetector.isImmutable(Class<?> cls)", "constructor": false, "full_signa...
{ "body": "static boolean isImmutable(Class<?> cls) {\n return !hasSetterMethod(cls) && !hasNoArgConstructor(cls) && !hasNonFinalField(cls);\n }", "class_method_signature": "MutabilityDetector.isImmutable(Class<?> cls)", "constructor": false, "full_signature": "static boolean isImmutable(Class<?> cls)...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_95
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void emptyShouldReturnEmpty() {\n Observable<Foo> fooObservable = RxUtils.singleOrEmpty(Observable.empty());\n\n assertThat(fooObservable.toList().toBlocking().single()).isEmpty();\n }", "class_method_signature": "RxUtilsTest.emptyShouldReturnEmpty()", "constructor": ...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {\n return collectionObservable.toList().concatMap(lists -> {\n if (lists.size() > 1) {\n return Observable.error(new IllegalArgumentException(\"Observable contains more ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_135
{ "fields": [], "file": "jaxrs-api/src/test/java/se/fortnox/reactivewizard/jaxrs/WebExceptionTest.java", "identifier": "WebExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldSetErrorToGivenValueWhenErrorCodeAndThrowableIsGiven() {\n WebException webException = new WebException(BAD_REQUEST, \"error_code\",new IllegalArgumentException(\"cause\"));\n assertThat(webException.getError()).isEqualTo(\"error_code\");\n assertThat(webEx...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "error", "modifier": "private", "original_string": "private String error;", ...
{ "body": "public String getError() {\n return error;\n }", "class_method_signature": "WebException.getError()", "constructor": false, "full_signature": "public String getError()", "identifier": "getError", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_162
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldLogRequestDetailsOnTimeout() {\n DisposableServer server = startServer(OK, Flux.never(), r -> {\n });\n\n try {\n TestResource resource = getHttpProxy(server.port());\n HttpClient.setTimeout(resource, 10, ChronoUnit.MILLIS);\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "public static void setTimeout(Object proxy, int timeout, ChronoUnit timeoutUnit) {\n if (Proxy.isProxyClass(proxy.getClass())) {\n Object handler = Proxy.getInvocationHandler(proxy);\n if (handler instanceof HttpClient) {\n ((HttpClient)handler).setTimeout(timeou...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }