Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:12

    dependabot[bot] on gradle

    (compare)

  • 06:12

    xvik on master

    Bump com.gradle.enterprise from… Merge pull request #241 from xv… (compare)

  • 06:12
    xvik closed #241
  • 06:12

    dependabot[bot] on gradle

    (compare)

  • 06:12

    xvik on master

    Bump io.spring.dependency-manag… Merge pull request #242 from xv… (compare)

  • 06:12
    xvik closed #242
  • Aug 10 23:14
    dependabot[bot] labeled #242
  • Aug 10 23:14
    dependabot[bot] opened #242
  • Aug 10 23:14

    dependabot[bot] on gradle

    Bump io.spring.dependency-manag… (compare)

  • Aug 10 23:14
    dependabot[bot] labeled #241
  • Aug 10 23:14
    dependabot[bot] opened #241
  • Aug 10 23:14

    dependabot[bot] on gradle

    Bump com.gradle.enterprise from… (compare)

  • Jul 15 23:11
    dependabot[bot] labeled #238
  • Jul 15 23:11
    dependabot[bot] opened #238
  • Jul 15 23:11

    dependabot[bot] on gradle

    Bump spock-core from 2.2-M1-gro… (compare)

  • Jul 12 05:03

    dependabot[bot] on gradle

    (compare)

  • Jul 12 05:03

    xvik on master

    Bump com.gradle.enterprise from… Merge pull request #237 from xv… (compare)

  • Jul 12 05:03
    xvik closed #237
  • Jul 11 23:13
    dependabot[bot] labeled #237
  • Jul 11 23:13
    dependabot[bot] opened #237
Vyacheslav Rusakov
@xvik
you configure prefix for DropwizardAppExtension and use the same prefix in each ConfigOverride
"randomPrefixString"
I will use this technique in guicey extensions so they would be independent out of the box! thank you for the idea! :)
Eddie Xie
@oeddyo
lol credits are all yours. I'm standing on your shoulder and peeking only
I meant that: if I use a prefix like you mentioned, for instance use the test class's name
io.dropwizard.configuration.ConfigurationValidationException: src/test/resources/dropwizard-test-config.yml has an error:
  * dataSourceFactory.url must not be empty
it complains that it needs to have url
oh
Vyacheslav Rusakov
@xvik
I suppose "oh" means you got what was wrong
Eddie Xie
@oeddyo
let me try it out. was missing the "each" part
ah!
oh my god can't believe this is real
image.png
yes your solution works!
Vyacheslav Rusakov
@xvik
))
Eddie Xie
@oeddyo
amazing! Not going to be ass kissing but this guicey project is the most amazing one-man OS project I've seen lol
Vyacheslav Rusakov
@xvik
thank you))
Eddie Xie
@oeddyo

Hi @xvik ! I'm using a guava cache in my filter: ``` @Inject
private SessionFactory sessionFactory;

@Inject
public CredentialRequiredFilter(AppDao appDao, Cache<String, App> appCache) {
this.appDao = appDao;
this.appCache = appCache;
}
```

sorry gitter code format is always a mystery to me
image.png
now I'm trying to replace the cache with a mock cache in test. I saw in GuiceyHook it's possible but I'm using junit-5. Is there anything I can do now or shall I wait for your changes?
Vyacheslav Rusakov
@xvik
hi!

hooks is a generic mechanism:

GuiceyConfigurationHook hook  = builder -> builder.extensions(...);

here lambda used instead of direct inteface implementation

to register hook: hook.register()
there only problem is to register it before application startap
your junit extension use BeforeAll hook, so it is impossible to register anything beofre extension execution
so you will have to add hooks support inside your extension (to register them before startup)
Eddie Xie
@oeddyo
i see. I'll try out and see if I can get it work
Vyacheslav Rusakov
@xvik
and about formatting: just start ''' on new line. To activate syntax highlighting put language name after it like '''java
Eddie Xie
@oeddyo
ah ok
thanks
hooks doc
Eddie Xie
@oeddyo
neat!
Eddie Xie
@oeddyo
image.png
I seem to get it working in the extension via:
i pass the overrideModule in the extension's constructor, and in the overrideModule I override the cache I wanted to mock. from the guice print it seems to be overridden
image.png
does this sound reasonable?
Vyacheslav Rusakov
@xvik
yes ofc, report confirms that
Eddie Xie
@oeddyo
it works!
Fazeem Mohammed
@fazeem84
@xvik i had a suggestion to dropwizard core project to add the application build version during startup,which is rejected unfortunately..i want to know your opinion about this feature dropwizard/dropwizard#3331
Vyacheslav Rusakov
@xvik
I agree that it is too specific addition (and could be easily done in the application if required).
Fazeem Mohammed
@fazeem84
Ok.. thanks for your opinion :)
Eddie Xie
@oeddyo
Hi @xvik I'm seeing my customized Exceptionmapper registered but it's not called when exception happens. The exception is thrown in one of the filter I created
Dynamic features
        CredentialRequiredFeature    (c.k.restful.filter)       
        LoginRequiredFeature         (c.k.restful.filter)       

    Exception mappers
        IndexNotFoundException         IndexNotFoundExceptionMapper (c.k.r.exceptionmapper)
ERROR [2020-06-16 18:22:29,915] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: c6536299f686a565
! org.apache.lucene.index.IndexNotFoundException: index 7617868c-fb63-41b5-81e6-50290cdc903exx does not exist
! at com.kalasearch.restful.filter.CredentialRequiredFilter.filter(CredentialRequiredFilter.java:61)
! at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:108)
maybe I'm not registering it correctly?
    bootstrap.addBundle(GuiceBundle.builder()
        .extensions(IndexNotFoundExceptionMapper.class)
        .extensions(
            AccountResource.class,
            AppResource.class,
            IndexResource.class,
            DocResource.class,
            CredentialRequiredFeature.class,
            LoginRequiredFeature.class
        )
Eddie Xie
@oeddyo
ah I found it probably has something to do with the exception is thrown in the ContainerRequestFilter
if it's thrown elsewhere, the ExceptionMapper can actually catch it