Polishing

This commit is contained in:
Oleg Zhurakousky
2025-01-14 16:06:32 +01:00
parent 936726a892
commit e46ed8a668

View File

@@ -108,7 +108,7 @@ public class FunctionInvokerTests {
+ " \"timestamp\": 1712716805129\n" + " \"timestamp\": 1712716805129\n"
+ " }\n" + " }\n"
+ "}"; + "}";
String scheduleEvent = "{\n" String scheduleEvent = "{\n"
+ " \"version\": \"0\",\n" + " \"version\": \"0\",\n"
+ " \"id\": \"17793124-05d4-b198-2fde-7ededc63b103\",\n" + " \"id\": \"17793124-05d4-b198-2fde-7ededc63b103\",\n"
@@ -766,7 +766,7 @@ public class FunctionInvokerTests {
System.clearProperty("spring.cloud.function.definition"); System.clearProperty("spring.cloud.function.definition");
//this.getEnvironment().clear(); //this.getEnvironment().clear();
} }
@Test @Test
public void testScheduledEvent() throws Exception { public void testScheduledEvent() throws Exception {
System.setProperty("MAIN_CLASS", ScheduledEventConfiguration.class.getName()); System.setProperty("MAIN_CLASS", ScheduledEventConfiguration.class.getName());
@@ -777,8 +777,7 @@ public class FunctionInvokerTests {
ByteArrayOutputStream output = new ByteArrayOutputStream(); ByteArrayOutputStream output = new ByteArrayOutputStream();
invoker.handleRequest(targetStream, output, null); invoker.handleRequest(targetStream, output, null);
String result = new String(output.toByteArray(), StandardCharsets.UTF_8); String result = new String(output.toByteArray(), StandardCharsets.UTF_8);
System.out.println("Result: " + result); assertThat(result).contains("IYV3p45BT0ac8hjHg1houSdS1a.Mro8e");
//assertThat(result).contains("APIGatewayCustomAuthorizerEvent(version=null, type=TOKEN");
} }
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" })
@@ -2014,11 +2013,11 @@ public class FunctionInvokerTests {
return this.name; return this.name;
} }
} }
@EnableAutoConfiguration @EnableAutoConfiguration
@Configuration @Configuration
public static class ScheduledEventConfiguration { public static class ScheduledEventConfiguration {
@Bean @Bean
public Function<ScheduledEvent, ScheduledEvent> event() { public Function<ScheduledEvent, ScheduledEvent> event() {
return event -> { return event -> {