BaseUrlHolder.set("http://localhost:8081/nexus");
try {
final M2Repository repository = (M2Repository) lookup(RepositoryRegistry.class).getRepository(REPO_ID);
{
final RoutingStatusMessageWrapper payload = wlStatusResource.get(null, request, null, null);
assertThat(payload, is(notNullValue()));
assertThat(payload.getData().getPublishedUrl(), is(notNullValue()));
assertThat(payload.getData().getPublishedUrl(), containsString(".meta/prefixes.txt"));
assertThat(payload.getData().getPublishedUrl(), containsString(REPO_ID));
}
repository.setExposed(false);
repository.commitChanges();
{
final RoutingStatusMessageWrapper payload = wlStatusResource.get(null, request, null, null);
assertThat(payload, is(notNullValue()));
assertThat(payload.getData().getPublishedUrl(), is(nullValue()));
}
repository.setExposed(true);
repository.commitChanges();
{
final RoutingStatusMessageWrapper payload = wlStatusResource.get(null, request, null, null);
assertThat(payload, is(notNullValue()));
assertThat(payload.getData().getPublishedUrl(), is(notNullValue()));
assertThat(payload.getData().getPublishedUrl(), containsString(".meta/prefixes.txt"));
assertThat(payload.getData().getPublishedUrl(), containsString(REPO_ID));
}
}
finally {
Response.setCurrent(null);
BaseUrlHolder.unset();