@Test public void testInitIcingaClient() throws Exception { Set<Object> registeredObjects = ((Client) ReflectionTestUtils.getField(testling, "icingaClient")).getConfiguration().getInstances(); assertEquals(registeredObjects.size(), 2); registeredObjects.forEach(e -> { if (e instanceof HttpAuthenticationFeature) { assertNotNull(ReflectionTestUtils.getField(e, "basicCredentials")); return; } if (e instanceof Icinga2RestCient.ErrorResponseFilter) { return; } throw new RuntimeException("not epected class of registered Object of 'icingaClient'"); }); }
@PostConstruct public void initIcingaClient() { icingaClient = ClientBuilder.newBuilder() .hostnameVerifier((s, sslSession) -> true) .sslContext(getTrustEverythingSSLContext()) .build() .register(HttpAuthenticationFeature.basic(properties.getApiUsername(), properties.getApiPassword())) .register(new ErrorResponseFilter()) .register(JacksonFeature.class); if (LOGGER.isDebugEnabled()) { icingaClient.register(LoggingFilter.class); } }
Icinga2RestCient { @PostConstruct public void initIcingaClient() { icingaClient = ClientBuilder.newBuilder() .hostnameVerifier((s, sslSession) -> true) .sslContext(getTrustEverythingSSLContext()) .build() .register(HttpAuthenticationFeature.basic(properties.getApiUsername(), properties.getApiPassword())) .register(new ErrorResponseFilter()) .register(JacksonFeature.class); if (LOGGER.isDebugEnabled()) { icingaClient.register(LoggingFilter.class); } } }
Icinga2RestCient { @PostConstruct public void initIcingaClient() { icingaClient = ClientBuilder.newBuilder() .hostnameVerifier((s, sslSession) -> true) .sslContext(getTrustEverythingSSLContext()) .build() .register(HttpAuthenticationFeature.basic(properties.getApiUsername(), properties.getApiPassword())) .register(new ErrorResponseFilter()) .register(JacksonFeature.class); if (LOGGER.isDebugEnabled()) { icingaClient.register(LoggingFilter.class); } }  }
Icinga2RestCient { @PostConstruct public void initIcingaClient() { icingaClient = ClientBuilder.newBuilder() .hostnameVerifier((s, sslSession) -> true) .sslContext(getTrustEverythingSSLContext()) .build() .register(HttpAuthenticationFeature.basic(properties.getApiUsername(), properties.getApiPassword())) .register(new ErrorResponseFilter()) .register(JacksonFeature.class); if (LOGGER.isDebugEnabled()) { icingaClient.register(LoggingFilter.class); } }  @PostConstruct void initIcingaClient(); WebTarget getTargetCheckResult(); }
Icinga2RestCient { @PostConstruct public void initIcingaClient() { icingaClient = ClientBuilder.newBuilder() .hostnameVerifier((s, sslSession) -> true) .sslContext(getTrustEverythingSSLContext()) .build() .register(HttpAuthenticationFeature.basic(properties.getApiUsername(), properties.getApiPassword())) .register(new ErrorResponseFilter()) .register(JacksonFeature.class); if (LOGGER.isDebugEnabled()) { icingaClient.register(LoggingFilter.class); } }  @PostConstruct void initIcingaClient(); WebTarget getTargetCheckResult();  }