Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions extensions-core/mysql-metadata-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.druid.metadata.storage.mysql.MySQLConnectorDriverConfig;
import org.apache.druid.metadata.storage.mysql.MySQLMetadataStorageModule;
import org.apache.druid.server.initialization.JdbcAccessSecurityConfig;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
Expand Down Expand Up @@ -167,7 +168,12 @@ public String getConnectURI()

JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of(""));

expectedException.expectMessage("The property [password] is not in the allowed list");
expectedException.expectMessage(
CoreMatchers.anyOf(
CoreMatchers.containsString("The property [password] is not in the allowed list"),
CoreMatchers.containsString("The property [user] is not in the allowed list")
)
);
expectedException.expect(IllegalArgumentException.class);

new MySQLInputSourceDatabaseConnector(
Expand Down Expand Up @@ -241,7 +247,12 @@ public String getConnectURI()

JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("none", "nonenone"));

expectedException.expectMessage("The property [password] is not in the allowed list");
expectedException.expectMessage(
CoreMatchers.anyOf(
CoreMatchers.containsString("The property [password] is not in the allowed list"),
CoreMatchers.containsString("The property [user] is not in the allowed list")
)
);
expectedException.expect(IllegalArgumentException.class);

new MySQLInputSourceDatabaseConnector(
Expand Down Expand Up @@ -291,7 +302,12 @@ public String getConnectURI()

JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("user", "nonenone"));

expectedException.expectMessage("The property [password] is not in the allowed list");
expectedException.expectMessage(
CoreMatchers.anyOf(
CoreMatchers.containsString("The property [password] is not in the allowed list"),
CoreMatchers.containsString("The property [keyonly] is not in the allowed list")
)
);
expectedException.expect(IllegalArgumentException.class);

new MySQLInputSourceDatabaseConnector(
Expand Down
Loading