use of com.google.cloud.servicedirectory.v1.Service in project dekorate by dekorateio.
the class Issue572Test method shouldHaveMatchingPath.
@Test
public void shouldHaveMatchingPath() {
KubernetesList list = Serialization.unmarshalAsList(getClass().getClassLoader().getResourceAsStream("META-INF/dekorate/knative.yml"));
assertNotNull(list);
Service s = findFirst(list, Service.class).orElseThrow(() -> new IllegalStateException());
assertNotNull(s);
assertEquals("cluster-local", s.getMetadata().getLabels().get("serving.knative.dev/visibility"));
}
use of com.google.cloud.servicedirectory.v1.Service in project dekorate by dekorateio.
the class Issue442MultiPlatformTest method shouldHaveCustomGroupAndVersionInKnativeYml.
@Test
public void shouldHaveCustomGroupAndVersionInKnativeYml() {
KubernetesList list = Serialization.unmarshalAsList(Issue442MultiPlatformTest.class.getClassLoader().getResourceAsStream("META-INF/dekorate/knative.yml"));
assertNotNull(list);
Service s = findFirst(list, Service.class).orElseThrow(() -> new IllegalStateException());
assertNotNull(s);
Map<String, String> labels = s.getMetadata().getLabels();
assertNotNull(labels);
assertEquals("kn-group", labels.get(Labels.PART_OF));
assertEquals("1.0-knative", labels.get(Labels.VERSION));
}
use of com.google.cloud.servicedirectory.v1.Service in project dekorate by dekorateio.
the class Feat642TrafficSplittingTest method shouldContainRequestsPerSecond.
@Test
public void shouldContainRequestsPerSecond() {
KubernetesList list = Serialization.unmarshalAsList(getClass().getClassLoader().getResourceAsStream("META-INF/dekorate/knative.yml"));
assertNotNull(list);
Service s = findFirst(list, Service.class).orElseThrow(() -> new IllegalStateException());
assertNotNull(s);
assertEquals(1, s.getSpec().getTraffic().size());
TrafficTarget traffic = s.getSpec().getTraffic().get(0);
assertEquals("my-revision", s.getSpec().getTemplate().getMetadata().getName());
assertEquals("my-revision", traffic.getRevisionName());
assertEquals((long) 80, traffic.getPercent());
assertFalse(traffic.getLatestRevision());
}
use of com.google.cloud.servicedirectory.v1.Service in project dekorate by dekorateio.
the class Feat575LocalAutoscalingTest method shouldContainRequestsPerSecond.
@Test
public void shouldContainRequestsPerSecond() {
KubernetesList list = Serialization.unmarshalAsList(getClass().getClassLoader().getResourceAsStream("META-INF/dekorate/knative.yml"));
assertNotNull(list);
Service s = findFirst(list, Service.class).orElseThrow(() -> new IllegalStateException());
String metric = s.getMetadata().getAnnotations().get("autoscaling.knative.dev/metric");
assertEquals("rps", metric);
String target = s.getMetadata().getAnnotations().get("autoscaling.knative.dev/target");
assertEquals("100", target);
}
use of com.google.cloud.servicedirectory.v1.Service in project dekorate by dekorateio.
the class Issue687KnativeVolumeTest method shouldHaveVolumesAndMounts.
@Test
public void shouldHaveVolumesAndMounts() {
KubernetesList list = Serialization.unmarshalAsList(getClass().getClassLoader().getResourceAsStream("META-INF/dekorate/knative.yml"));
assertNotNull(list);
Service s = findFirst(list, Service.class).orElseThrow(() -> new IllegalStateException());
assertNotNull(s);
assertTrue(s.getSpec().getTemplate().getSpec().getVolumes().size() > 0);
Container c = s.getSpec().getTemplate().getSpec().getContainers().get(0);
assertNotNull(c);
assertTrue(c.getVolumeMounts().size() > 0);
}
Aggregations