Home / Class/ RandomStringTests Class — spring-boot Architecture

RandomStringTests Class — spring-boot Architecture

Architecture documentation for the RandomStringTests class in RandomStringTests.java from the spring-boot codebase.

Entity Profile

Source Code

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/RandomStringTests.java lines 29–47

class RandomStringTests {

	@Test
	@SuppressWarnings("NullAway") // Test null check
	void generateWhenPrefixIsNullThrowsException() {
		assertThatIllegalArgumentException().isThrownBy(() -> RandomString.generate(null, 10))
			.withMessage("'prefix' must not be null");
	}

	@Test
	void generateGeneratesRandomString() {
		String s1 = RandomString.generate("abc-", 10);
		String s2 = RandomString.generate("abc-", 10);
		String s3 = RandomString.generate("abc-", 20);
		assertThat(s1).hasSize(14).startsWith("abc-").isNotEqualTo(s2);
		assertThat(s3).hasSize(24).startsWith("abc-");
	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free