Operators { public static void addAll(final PostgresQueryWriterResolver resolver) { resolver.addQueryWriter("$eq", formattedCheckWriter("((%s)=to_json(?)::jsonb)")); resolver.addQueryWriter("$ne", formattedCheckWriter("((%s)!=to_json(?)::jsonb)")); resolver.addQueryWriter("$lt", formattedCheckWriter("((%s)<to_json(?)::jsonb)")); resolver.addQueryWriter("$gt", formattedCheckWriter("((%s)>to_json(?)::jsonb)")); resolver.addQueryWriter("$lte", formattedCheckWriter("((%s)<=to_json(?)::jsonb)")); resolver.addQueryWriter("$gte", formattedCheckWriter("((%s)>=to_json(?)::jsonb)")); resolver.addQueryWriter("$isNull", Operators::writeFieldExistsCheckCondition); resolver.addQueryWriter("$date-from", formattedCheckWriter("(parse_timestamp_immutable(%s)>=(?)::timestamp)")); resolver.addQueryWriter("$date-to", formattedCheckWriter("(parse_timestamp_immutable(%s)<=(?)::timestamp)")); resolver.addQueryWriter("$in", Operators::writeFieldInArrayCheckCondition); resolver.addQueryWriter("$hasTag", formattedCheckWriter("((%s)??(?))")); resolver.addQueryWriter("$fulltext", formattedCheckWriter( String.format("%s@@(to_tsquery('%s',?))", PostgresSchema.FULLTEXT_COLUMN, PostgresSchema.FTS_DICTIONARY))); } private  Operators(); static void addAll(final PostgresQueryWriterResolver resolver);  }
@Test public void should_AddsAllOperators() throws Exception { PostgresQueryWriterResolver resolverMock = mock(PostgresQueryWriterResolver.class); Operators.addAll(resolverMock); verify(resolverMock, times(12)).addQueryWriter(anyString(), anyObject()); }