Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.xtrmetl.cdc.replication;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.jdbc.core.JdbcTemplate;

import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;

class SchemaChangeReplicaValidationModeTest {

@Test
void rejectsBlankValidationModeInsteadOfSilentlyDisablingPolicy() {
JdbcTemplate jdbcTemplate = mock(JdbcTemplate.class);

assertThrows(
IllegalArgumentException.class,
() -> new SchemaChangeReplicaApplier(
jdbcTemplate,
new ObjectMapper(),
true,
" ",
"CREATE TABLE,ALTER TABLE,CREATE INDEX",
"DROP TABLE,DROP SCHEMA,DROP DATABASE,TRUNCATE"
)
);
}

@Test
void rejectsNullValidationModeInsteadOfSilentlyDisablingPolicy() {
JdbcTemplate jdbcTemplate = mock(JdbcTemplate.class);

assertThrows(
IllegalArgumentException.class,
() -> new SchemaChangeReplicaApplier(
jdbcTemplate,
new ObjectMapper(),
true,
null,
"CREATE TABLE,ALTER TABLE,CREATE INDEX",
"DROP TABLE,DROP SCHEMA,DROP DATABASE,TRUNCATE"
)
);
}
}
Loading