### Question:
VaultKvAccessStrategyFactory { public static VaultKvAccessStrategy forVersion(RestOperations rest, String baseUrl, int version) { switch (version) { case 1: return new V1VaultKvAccessStrategy(baseUrl, rest); case 2: return new V2VaultKvAccessStrategy(baseUrl, rest); default: throw new IllegalArgumentException("No support for given Vault k/v backend version " + version); } } private  VaultKvAccessStrategyFactory(); static VaultKvAccessStrategy forVersion(RestOperations rest, String baseUrl, int version);  }### Answer:
@Test public void testGetV1Strategy() { VaultKvAccessStrategy vaultKvAccessStrategy = VaultKvAccessStrategyFactory.forVersion(null, "foo", 1); assertThat(vaultKvAccessStrategy instanceof V1VaultKvAccessStrategy).isTrue(); }
@Test public void testGetV2Strategy() { VaultKvAccessStrategy vaultKvAccessStrategy = VaultKvAccessStrategyFactory.forVersion(null, "foo", 2); assertThat(vaultKvAccessStrategy instanceof V2VaultKvAccessStrategy).isTrue(); }
@Test(expected = IllegalArgumentException.class) public void testGetUnsupportedStrategy() { VaultKvAccessStrategyFactory.forVersion(null, "foo", 0); }