### Question:
AwsLifeCycleMapper { public CloudInstanceLifeCycle getLifeCycle(Instance instance) { return InstanceLifecycleType.Spot.toString().equals(instance.getInstanceLifecycle()) ? CloudInstanceLifeCycle.SPOT : CloudInstanceLifeCycle.NORMAL; }  CloudInstanceLifeCycle getLifeCycle(Instance instance);  }### Answer:
@Test void spotLifeCycle() { Instance spotInstance = new Instance().withInstanceLifecycle(InstanceLifecycleType.Spot); CloudInstanceLifeCycle lifeCycle = underTest.getLifeCycle(spotInstance); Assertions.assertThat(lifeCycle).isEqualTo(CloudInstanceLifeCycle.SPOT); }
@Test void scheduledLifeCycle() { Instance scheduledInstance = new Instance().withInstanceLifecycle(InstanceLifecycleType.Scheduled); CloudInstanceLifeCycle lifeCycle = underTest.getLifeCycle(scheduledInstance); Assertions.assertThat(lifeCycle).isEqualTo(CloudInstanceLifeCycle.NORMAL); }
@Test void nullLifeCycle() { Instance onDemandInstance = new Instance().withInstanceLifecycle((String) null); CloudInstanceLifeCycle lifeCycle = underTest.getLifeCycle(onDemandInstance); Assertions.assertThat(lifeCycle).isEqualTo(CloudInstanceLifeCycle.NORMAL); }