Commit 677f26ad authored by Noel Alonso's avatar Noel Alonso
Browse files

Cambia schemaRegistry a server local, adapta tests

parent 7c2658ed
Loading
Loading
Loading
Loading
+41 −36
Original line number Diff line number Diff line
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<parent>
@@ -32,14 +33,10 @@

		<!-- OTHER -->
		<spring-security-oauth2.version>2.3.0.RELEASE</spring-security-oauth2.version>
		<confluent.version>4.1.0</confluent.version>
		<kafka.version>1.1.0</kafka.version>

		<!-- Plugins -->
		<jacoco.version>0.8.1</jacoco.version>
		
		<!-- Environment variables -->
		<env.MAVEN_REPO_URL>https://artifactory.redmic.net/artifactory</env.MAVEN_REPO_URL>
	</properties>

	<dependencies>
@@ -72,6 +69,20 @@
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-websocket</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>log4j-over-slf4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
@@ -149,19 +160,6 @@
			<scope>test</scope>
		</dependency>
	</dependencies>
	<distributionManagement>
		<repository>
			<id>central</id>
			<name>redmic-releases</name>
			<url>${env.MAVEN_REPO_URL}/libs-release-local</url>
		</repository>
		<snapshotRepository>
			<id>snapshots</id>
			<name>redmic-snapshots</name>
			<url>${env.MAVEN_REPO_URL}/libs-snapshot-local</url>
			<uniqueVersion>false</uniqueVersion>
		</snapshotRepository>
	</distributionManagement>
	<repositories>
		<repository>
			<id>confluent</id>
@@ -187,6 +185,13 @@
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<reuseForks>false</reuseForks>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ oauth.server=http://redmic.net:8081

spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}

spring.kafka.properties.schema.registry.url=http://redmic.net:18081
spring.kafka.properties.schema.registry.url=http://localhost:${schema.registry.port}

#TEST USERS

+2 −0
Original line number Diff line number Diff line
@@ -18,11 +18,13 @@ import org.junit.runner.RunWith;
import org.springframework.messaging.simp.stomp.StompFrameHandler;
import org.springframework.messaging.simp.stomp.StompHeaders;
import org.springframework.messaging.simp.stomp.StompSession;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import es.redmic.socket.test.integration.common.SocketIntegrationTestBase;

@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties = { "schema.registry.port=18093" })
public class WebSocketTest extends SocketIntegrationTestBase {

	Long userId = 13L;
+8 −2
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;

import javax.annotation.PostConstruct;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.ClassRule;
@@ -21,7 +23,6 @@ import org.springframework.messaging.simp.stomp.StompHeaders;
import org.springframework.messaging.simp.stomp.StompSession;
import org.springframework.messaging.simp.stomp.StompSessionHandler;
import org.springframework.messaging.simp.stomp.StompSessionHandlerAdapter;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.socket.WebSocketHttpHeaders;
@@ -41,7 +42,6 @@ import es.redmic.testutils.oauth.IntegrationTestBase;
@SpringBootTest(classes = { SocketApplication.class,
		SocketApplicationTest.class }, webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
@DirtiesContext
public abstract class SocketIntegrationTestBase extends IntegrationTestBase {

	protected final static String JOB_PARAMETER_KEY = "parameters";
@@ -53,6 +53,12 @@ public abstract class SocketIntegrationTestBase extends IntegrationTestBase {
	@ClassRule
	public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1);

	@PostConstruct
	public void SocketIntegrationTestBasePostConstruct() throws Exception {

		createSchemaRegistryRestApp(embeddedKafka.getZookeeperConnectionString(), embeddedKafka.getBrokersAsString());
	}

	@LocalServerPort
	int port;

+2 −0
Original line number Diff line number Diff line
@@ -4,11 +4,13 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import es.redmic.socket.test.integration.ingest.common.IngestBaseTest;

@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties = { "schema.registry.port=18081" })
public class IngestDataDocumentTest extends IngestBaseTest {

	// @formatter:off
Loading