Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 29 23:58
    abhishekkaura opened #252
  • Sep 29 23:15
    dependabot[bot] labeled #251
  • Sep 29 23:15

    dependabot[bot] on gradle

    Bump spock-core from 2.2-groovy… (compare)

  • Sep 29 23:15
    dependabot[bot] opened #251
  • Sep 22 05:55

    dependabot[bot] on gradle

    (compare)

  • Sep 22 05:54

    xvik on master

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

  • Sep 22 05:54
    xvik closed #250
  • Sep 21 23:13
    dependabot[bot] labeled #250
  • Sep 21 23:13
    dependabot[bot] opened #250
  • Sep 21 23:13

    dependabot[bot] on gradle

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

  • Sep 13 06:32

    dependabot[bot] on gradle

    (compare)

  • Sep 13 06:32
    xvik closed #249
  • Sep 13 06:32

    xvik on master

    Bump dropwizard-dependencies fr… Merge pull request #249 from xv… (compare)

  • Sep 12 23:10
    dependabot[bot] labeled #249
  • Sep 12 23:10
    dependabot[bot] opened #249
  • Sep 12 23:10

    dependabot[bot] on gradle

    Bump dropwizard-dependencies fr… (compare)

  • Sep 11 07:26

    dependabot[bot] on gradle

    (compare)

  • Sep 11 07:26

    xvik on master

    Bump net.researchgate.release f… Merge pull request #248 from xv… (compare)

  • Sep 11 07:26
    xvik closed #248
  • Sep 09 23:59
    dependabot[bot] opened #248
Vyacheslav Rusakov
@xvik
mmm! i just thought! there is a way to overcome property limitation!
ConfigOverride maps configuration properties to system properties with custom prefix (dw. by default). And you can(!!!) change this prefix!
Eddie Xie
@oeddyo
saw the "prefix" param too. But I assume in DW internal it's expecting dw.database.url instead of A.dw.database.url?
Vyacheslav Rusakov
@xvik
 new DropwizardAppExtension<>(
            HttpServer.class,
            "src/test/resources/dropwizard-test-config.yml",
          "randomPrefixString",
            ConfigOverride.config("randomPrefixString",
                "database.url",
                singleInstancePostgresExtension.getEmbeddedPostgres().getJdbcUrl(
                    "postgres", "postgres")
            ),
            ConfigOverride.config("randomPrefixString",
                "server.applicationConnectors[0].port", String.valueOf(0)
            ),
            ConfigOverride.config("randomPrefixString",
                "server.adminConnectors[0].port", String.valueOf(0)
            ),
            ConfigOverride.config("randomPrefixString",
                "engine.indexDataPrefix",
                tempDir.toAbsolutePath().toString()
            )
        );
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)