void checkForUpdate() throws IOException {
		final String anonymousData = getAnonymousData();
		final HttpURLConnection connection = (HttpURLConnection) new URL(serverUrl)
				.openConnection();
		connection.setUseCaches(false);
		connection.setDoOutput(true);
		connection.setRequestMethod("POST");
		connection.setConnectTimeout(60000);
		connection.setReadTimeout(60000);
		connection.setRequestProperty("data", anonymousData);
		connection.connect();

		final Properties properties = new Properties();
		try (InputStream input = connection.getInputStream()) {
			properties.load(input);
		}
		final String javamelodyVersion = properties.getProperty("version");
		if (javamelodyVersion != null && Parameters.JAVAMELODY_VERSION != null
				&& javamelodyVersion.compareTo(Parameters.JAVAMELODY_VERSION) > 0) {
			setNewJavamelodyVersion(javamelodyVersion);
		}
	}
@Test
	public void testCheckForUpdate() throws IOException {
		final ServletContext context = createNiceMock(ServletContext.class);
		expect(context.getMajorVersion()).andReturn(5).anyTimes();
		expect(context.getMinorVersion()).andReturn(0).anyTimes();
		expect(context.getContextPath()).andReturn("/test").anyTimes();
		replay(context);
		Parameters.initialize(context);
		verify(context);
		final Collector collector = new Collector("test",
				List.of(new Counter("http", null), new Counter("sql", null)));
		JRobin.initBackendFactory(new Timer(getClass().getSimpleName(), true));
		assertNotNull("SessionListener", new SessionListener());
		TestDatabaseInformations.initJdbcDriverParameters();
		collector.collectWithoutErrors(List.of(new JavaInformations(null, true)));
		final String serverUrl = "http://dummy";
		final UpdateChecker updateCheckerCollectorServer = UpdateChecker.createForTest(null,
				UpdateChecker.COLLECTOR_SERVER_APPLICATION_TYPE, serverUrl);
		try {
			updateCheckerCollectorServer.checkForUpdate();
		} catch (final UnknownHostException e) {
			// UnknownHostException is ok for url http://dummy
			assertNotNull("updateCheckerCollectorServer", updateCheckerCollectorServer);
		}
		Utils.setProperty(Parameter.NO_DATABASE, "true");
		Utils.setProperty(Parameter.LOG, "true");
		if (CacheManager.getInstance().getCache("test") == null) {
			CacheManager.getInstance().addCache("test");
		}
		final UpdateChecker updateChecker = UpdateChecker.createForTest(collector, "Classic",
				serverUrl);
		try {
			updateChecker.checkForUpdate();
		} catch (final UnknownHostException e) {
			// UnknownHostException is ok for url http://dummy
			assertNotNull("updateChecker", updateChecker);
		}
		CacheManager.getInstance().removeCache("test");
	}