Polish GroupsMetadata.Registration
Unify `Registration` and `DefualtRegistration` into a single class since they are both package-private and the interface isn't really needed.
This commit is contained in:
committed by
rstoyanchev
parent
abbee1a050
commit
d2246162c3
@@ -39,7 +39,6 @@ import org.springframework.core.test.tools.TestCompiler;
|
||||
import org.springframework.javapoet.CodeBlock;
|
||||
import org.springframework.javapoet.MethodSpec;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.service.registry.GroupsMetadata.DefaultRegistration;
|
||||
import org.springframework.web.service.registry.GroupsMetadata.Registration;
|
||||
import org.springframework.web.service.registry.HttpServiceGroup.ClientType;
|
||||
import org.springframework.web.service.registry.echo.EchoA;
|
||||
@@ -59,21 +58,21 @@ class GroupsMetadataValueDelegateTests {
|
||||
|
||||
@Test
|
||||
void generateRegistrationWithOnlyName() {
|
||||
DefaultRegistration registration = new DefaultRegistration("test", ClientType.UNSPECIFIED);
|
||||
Registration registration = new Registration("test", ClientType.UNSPECIFIED);
|
||||
compile(registration, (instance, compiled) -> assertThat(instance)
|
||||
.isInstanceOfSatisfying(Registration.class, hasRegistration("test", ClientType.UNSPECIFIED)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateRegistrationWitNoHttpServiceTypeName() {
|
||||
DefaultRegistration registration = new DefaultRegistration("test", ClientType.REST_CLIENT);
|
||||
Registration registration = new Registration("test", ClientType.REST_CLIENT);
|
||||
compile(registration, (instance, compiled) -> assertThat(instance)
|
||||
.isInstanceOfSatisfying(Registration.class, hasRegistration("test", ClientType.REST_CLIENT)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateRegistrationWitOneHttpServiceTypeName() {
|
||||
DefaultRegistration registration = new DefaultRegistration("test", ClientType.WEB_CLIENT,
|
||||
Registration registration = new Registration("test", ClientType.WEB_CLIENT,
|
||||
httpServiceTypeNames("com.example.MyClient"));
|
||||
compile(registration, (instance, compiled) -> assertThat(instance)
|
||||
.isInstanceOfSatisfying(Registration.class, hasRegistration(
|
||||
@@ -82,7 +81,7 @@ class GroupsMetadataValueDelegateTests {
|
||||
|
||||
@Test
|
||||
void generateRegistrationWitHttpServiceTypeNames() {
|
||||
DefaultRegistration registration = new DefaultRegistration("test", ClientType.WEB_CLIENT,
|
||||
Registration registration = new Registration("test", ClientType.WEB_CLIENT,
|
||||
httpServiceTypeNames("com.example.MyClient", "com.example.another.TestClient"));
|
||||
compile(registration, (instance, compiled) -> assertThat(instance)
|
||||
.isInstanceOfSatisfying(Registration.class, hasRegistration(
|
||||
|
||||
Reference in New Issue
Block a user