@Test public void test_should_return_false_when_given_tenant_is_less_specific_than_other_tenant() { final MessageIdentity messageIdentity1 = MessageIdentity.builder() .locale("en_IN") .module("module") .code("code1") .tenant(new Tenant("mh.panvel")) .build(); final Message message1 = Message.builder() .message("mh.panvel message") .messageIdentity(messageIdentity1) .build(); final MessageIdentity messageIdentity2 = MessageIdentity.builder() .locale("en_IN") .module("module") .code("code1") .tenant(new Tenant("mh")) .build(); final Message message2 = Message.builder() .message("mh message") .messageIdentity(messageIdentity2) .build(); assertFalse(message2.isMoreSpecificComparedTo(message1)); }
public boolean isMoreSpecificComparedTo(Message otherMessage) { final Tenant otherTenant = otherMessage.getMessageIdentity().getTenant(); return messageIdentity.getTenant().isMoreSpecificComparedTo(otherTenant); }
Message { public boolean isMoreSpecificComparedTo(Message otherMessage) { final Tenant otherTenant = otherMessage.getMessageIdentity().getTenant(); return messageIdentity.getTenant().isMoreSpecificComparedTo(otherTenant); } }
Message { public boolean isMoreSpecificComparedTo(Message otherMessage) { final Tenant otherTenant = otherMessage.getMessageIdentity().getTenant(); return messageIdentity.getTenant().isMoreSpecificComparedTo(otherTenant); }  }
Message { public boolean isMoreSpecificComparedTo(Message otherMessage) { final Tenant otherTenant = otherMessage.getMessageIdentity().getTenant(); return messageIdentity.getTenant().isMoreSpecificComparedTo(otherTenant); }  boolean isMoreSpecificComparedTo(Message otherMessage); String getCode(); String getModule(); String getLocale(); String getTenant(); }
Message { public boolean isMoreSpecificComparedTo(Message otherMessage) { final Tenant otherTenant = otherMessage.getMessageIdentity().getTenant(); return messageIdentity.getTenant().isMoreSpecificComparedTo(otherTenant); }  boolean isMoreSpecificComparedTo(Message otherMessage); String getCode(); String getModule(); String getLocale(); String getTenant();  }