Closed id-regis closed 8 years ago
Test are passing on my side only a timeout. But host registration still doesn't work in Consul due to a bug in Boon (https://github.com/boonproject/boon/issues/352)
I will take a look.
Are you sure?
The JsonMapper that ships with QBit is preconfigure to handle annotations.
This works
package io.advantageous.qbit.bugs;
import io.advantageous.boon.json.annotations.JsonProperty;
import io.advantageous.qbit.QBit;
import io.advantageous.qbit.json.JsonMapper;
import org.junit.Assert;
import org.junit.Test;
public class BoonBug352 {
@Test
public void test() {
Registration registration = new Registration();
registration.setName("name");
registration.setHost("localhost");
final JsonMapper mapper = QBit.factory().createJsonMapper();
String jsonSource = "{\"Name\":\"name\",\"Address\":\"localhost\"}";
Registration unserializedRegistration = mapper.fromJson(jsonSource, Registration.class);
String json = mapper.toJson(unserializedRegistration);
Assert.assertEquals(jsonSource, json);
}
public static class Registration {
@JsonProperty("Name")
private String name;
@JsonProperty("Address")
private String host;
public String getName() {
return name;
}
public Registration setName(String name) {
this.name = name;
return this;
}
public String getHost() {
return host;
}
public Registration setHost(String host) {
this.host = host;
return this;
}
}
}
That said.. we should never output two fields. I will look into that.
Ok.. I found the issue.
Merge master into your branch and try it again.
Thank for the patch it fixes the issue. Build and tests pass on my side.
you are welcome.. thanks for contributing.
Currently it's impossible to retrieve tags from service discovery or pass tags to an endpoint, this pull request allow to set tags then register them into service discovery provider. It also add host in Registration domain from Consul