|
|
|
@ -42,17 +42,17 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> { |
|
|
|
|
|
|
|
|
|
|
|
private final Class<?> type; |
|
|
|
private final Class<?> type; |
|
|
|
|
|
|
|
|
|
|
|
private final String path; |
|
|
|
private final String id; |
|
|
|
|
|
|
|
|
|
|
|
private final boolean sensitive; |
|
|
|
private final boolean sensitive; |
|
|
|
|
|
|
|
|
|
|
|
private final String property; |
|
|
|
private final String property; |
|
|
|
|
|
|
|
|
|
|
|
public AbstractEndpointTests(Class<?> configClass, Class<?> type, String path, |
|
|
|
public AbstractEndpointTests(Class<?> configClass, Class<?> type, String id, |
|
|
|
boolean sensitive, String property) { |
|
|
|
boolean sensitive, String property) { |
|
|
|
this.configClass = configClass; |
|
|
|
this.configClass = configClass; |
|
|
|
this.type = type; |
|
|
|
this.type = type; |
|
|
|
this.path = path; |
|
|
|
this.id = id; |
|
|
|
this.sensitive = sensitive; |
|
|
|
this.sensitive = sensitive; |
|
|
|
this.property = property; |
|
|
|
this.property = property; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -72,8 +72,8 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void getPath() throws Exception { |
|
|
|
public void getId() throws Exception { |
|
|
|
assertThat(getEndpointBean().getPath(), equalTo(this.path)); |
|
|
|
assertThat(getEndpointBean().getId(), equalTo(this.id)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -82,12 +82,12 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void pathOverride() throws Exception { |
|
|
|
public void idOverride() throws Exception { |
|
|
|
this.context = new AnnotationConfigApplicationContext(); |
|
|
|
this.context = new AnnotationConfigApplicationContext(); |
|
|
|
TestUtils.addEnviroment(this.context, this.property + ".path:/mypath"); |
|
|
|
TestUtils.addEnviroment(this.context, this.property + ".id:myid"); |
|
|
|
this.context.register(this.configClass); |
|
|
|
this.context.register(this.configClass); |
|
|
|
this.context.refresh(); |
|
|
|
this.context.refresh(); |
|
|
|
assertThat(getEndpointBean().getPath(), equalTo("/mypath")); |
|
|
|
assertThat(getEndpointBean().getId(), equalTo("myid")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
|