-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Description
private final RabbitProperties properties = new RabbitProperties();
@Test
void determineUsernameWithoutPassword() {
this.properties.setAddresses("user@rabbit1.example.com:1234/alpha");
assertThat(this.properties.determineUsername()).isEqualTo("user");
assertThat(this.properties.determinePassword()).isEqualTo("guest");
}
This throws an NPE:
java.lang.NullPointerException: Cannot load from object array because "split" is null
at org.springframework.boot.autoconfigure.amqp.RabbitProperties$Address.parseUsernameAndPassword(RabbitProperties.java:1135)
at org.springframework.boot.autoconfigure.amqp.RabbitProperties$Address.<init>(RabbitProperties.java:1112)
at org.springframework.boot.autoconfigure.amqp.RabbitProperties.parseAddresses(RabbitProperties.java:223)
at org.springframework.boot.autoconfigure.amqp.RabbitProperties.setAddresses(RabbitProperties.java:217)
at org.springframework.boot.autoconfigure.amqp.RabbitPropertiesTests.determineUsernameWithoutPassword(RabbitPropertiesTests.java:233)
...
The code expects that username and password is given, only username doesn't work.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug