This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into aruha-1322
- Loading branch information
Showing
24 changed files
with
539 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/acceptance-test/java/org/zalando/nakadi/webservice/StorageControllerAT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.zalando.nakadi.webservice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.zalando.nakadi.utils.EventTypeTestBuilder; | ||
import org.zalando.nakadi.webservice.utils.NakadiTestUtils; | ||
|
||
import static com.jayway.restassured.RestAssured.given; | ||
import static com.jayway.restassured.http.ContentType.JSON; | ||
|
||
public class StorageControllerAT extends BaseAT { | ||
|
||
@Test | ||
public void shouldChangeDefaultStorageWhenRequested() throws Exception { | ||
given() | ||
.body("{\"id\": \"default-test\",\"kafka_configuration\": {\"exhibitor_address\": null," + | ||
"\"exhibitor_port\": 0,\"zk_address\": \"127.0.0.1:2181\",\"zk_path\": \"\"}," + | ||
"\"storage_type\": \"kafka\"}") | ||
.contentType(JSON).post("/storages"); | ||
|
||
NakadiTestUtils.createEventTypeInNakadi(EventTypeTestBuilder.builder().name("event_a").build()); | ||
String storageId = (String) NakadiTestUtils.listTimelines("event_a").get(0).get("storage_id"); | ||
Assert.assertEquals("default", storageId); | ||
|
||
given().contentType(JSON).put("/storages/default/default-test"); | ||
NakadiTestUtils.createEventTypeInNakadi(EventTypeTestBuilder.builder().name("event_b").build()); | ||
storageId = (String) NakadiTestUtils.listTimelines("event_b").get(0).get("storage_id"); | ||
Assert.assertEquals("default-test", storageId); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/org/zalando/nakadi/domain/DefaultStorage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.zalando.nakadi.domain; | ||
|
||
public class DefaultStorage { | ||
|
||
private volatile Storage storage; | ||
|
||
public DefaultStorage(final Storage storage) { | ||
this.storage = storage; | ||
} | ||
|
||
public void setStorage(final Storage storage) { | ||
this.storage = storage; | ||
} | ||
|
||
public Storage getStorage() { | ||
return storage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.