Skip to content

Commit

Permalink
fix: Ensure that the name property of @ComponentApplication is applied
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Jul 18, 2019
1 parent 9e704c3 commit f6545a1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void shouldExposeService() {
Optional<Component> component = findFirst(list, Component.class);
assertTrue(component.isPresent());
assertTrue(component.get().getSpec().isExposeService());
assertEquals("issue-254", component.get().getMetadata().getName());
assertEquals(8080, (long)component.get().getSpec().getPort());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import io.dekorate.component.annotation.ComponentApplication;

@SpringBootApplication
@ComponentApplication(exposeService=true)
@ComponentApplication(exposeService=true, name="customName")
public class DemoApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void shouldExposeServiceAndHaveCorrectPort() {
Optional<Component> component = findFirst(list, Component.class);
assertTrue(component.isPresent());
assertTrue(component.get().getSpec().isExposeService());
assertEquals("customName", component.get().getMetadata().getName());
assertEquals(9090, (long)component.get().getSpec().getPort());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private BaseConfig getKubernetesConfig() {
private Component createComponent(ComponentConfig config) {
return new ComponentBuilder()
.withNewMetadata()
.withName(resources.getName())
.withName(config.getName())
.withLabels(resources.getLabels())
.endMetadata()
.withNewSpec()
Expand Down

0 comments on commit f6545a1

Please sign in to comment.