@TestConfiguration public class AdminSpringBootTestConfiguration {
@TestConfiguration public static class MissingCatalogAndCatalogServiceConfiguration { public MissingCatalogAndCatalogServiceConfiguration(Catalog catalog, CatalogService catalogService) { } @Bean public ServiceInstanceService serviceInstanceService() { return new TestServiceInstanceService(); } }
@TestConfiguration public class TestConfig { @Bean public Foo foo() { return new Foo("from test config"); } } }
@TestConfiguration public class TestConfig { @Bean public Foo foo() { return new Foo("from test config"); } }
@TestConfiguration public static class TestConfig { @Bean public MultipartConfigElement multipartConfigElement() { return new MultipartConfigElement("myLocation"); } }
@TestConfiguration static class Config { @Bean CamelFriend camelFriend() { return mock(CamelFriend.class); } }
@TestConfiguration static class S3TestConfiguration { @Bean public S3Client s3Client() { return S3Client.create(); } }
@TestConfiguration public static class MissingInstanceServiceConfiguration { public MissingInstanceServiceConfiguration(ServiceInstanceService serviceInstanceService) { } @Bean public Catalog catalog() { return Catalog.builder().build(); } }
@TestConfiguration public static class TestConfig { @Bean public MultipartConfigElement multipartConfigElement() { return new MultipartConfigElement("myLocation"); } } }
@TestConfiguration static class Config { @Bean public RestTemplateBuilder restTemplateBuilder() { return new RestTemplateBuilder() .additionalMessageConverters(new GsonHttpMessageConverter()); } } }
@TestConfiguration static class SSMTestConfiguration { @Bean public SsmClient ssmClient() { SsmClient mock = mock(SsmClient.class); when(mock.getParametersByPath(any(GetParametersByPathRequest.class))).thenReturn( GetParametersByPathResponse.builder() .parameters(Parameter.builder().name("mongo/password").value("secret").build()) .build() ); return mock; } }
@TestConfiguration public static class MockConfiguration { @Bean @Primary public GreetingMessageService greetingMessageService() { return mock(GreetingMessageService.class); } } }
@TestConfiguration public class TestConfig { @Bean public Foo foo() { return new Foo("from test config"); } @Bean public Foo foo2() { return new Foo("from test config2"); } }
@TestConfiguration public static class MinimalWithCatalogConfiguration { @Bean public Catalog catalog() { return Catalog.builder().build(); } @Bean public ServiceInstanceService serviceInstanceService() { return new TestServiceInstanceService(); } }
@TestConfiguration public static class MissingAllConfiguration { public MissingAllConfiguration(Catalog catalog, CatalogService catalogService, ServiceInstanceService serviceInstanceService) { } }
@TestConfiguration public static class TestConfig { @Bean(name = "ipBlockInterceptor") @GrpcGlobalInterceptor public ServerInterceptor ipBlockInterceptor() { return new IpBlockInterceptor(); } } }
@TestConfiguration public static class FullServicesWithCatalogConfiguration { @Bean public Catalog catalog() { return Catalog.builder().build(); } @Bean public ServiceInstanceService serviceInstanceService() { return new TestServiceInstanceService(); } @Bean public ServiceInstanceBindingService serviceInstanceBindingService() { return new TestServiceInstanceBindingService(); } }
@TestConfiguration public static class TestConfig { @Bean(name = "globalInterceptor") @GrpcGlobalInterceptor public ServerInterceptor globalInterceptor() { ServerInterceptor mock = mock(ServerInterceptor.class); Mockito.when(mock.interceptCall(any(), any(), any())).thenAnswer( (Answer<ServerCall.Listener>) invocation -> ((ServerCallHandler) invocation.getArguments()[2]).startCall( (ServerCall) invocation.getArguments()[0], (Metadata) invocation.getArguments()[1] )); return mock; } } }
@TestConfiguration public static class FullServicesConfiguration { @Bean public CatalogService catalogService() { return new TestCatalogService(); } @Bean public ServiceInstanceService serviceInstanceService() { return new TestServiceInstanceService(); } @Bean public ServiceInstanceBindingService serviceInstanceBindingService() { return new TestServiceInstanceBindingService(); } }
@TestConfiguration public static class CatalogAndCatalogServiceConfiguration { @Bean public Catalog catalog() { return Catalog.builder().build(); } @Bean public CatalogService catalogService() { return new TestCatalogService(); } @Bean public ServiceInstanceService serviceInstanceService() { return new TestServiceInstanceService(); } }