target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test void convertsSc2ApiActionUiSelectWarpGates() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithSelectWarpGates()); assertThatCorrectActionIsConverted(Action.SELECT_WARP_GATES, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsSc2ApiActionUiSelectLarva() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithSelectLarva()); assertThatCorrectActionIsConverted(Action.SELECT_LARVA, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsSc2ApiActionUiSelectIdleWorker() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithSelectIdleWorker()); assertThatCorrectActionIsConverted(Action.SELECT_IDLE_WORKER, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsSc2ApiActionUiMultiPanel() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithMultiPanel()); assertThatCorrectActionIsConverted(Action.MULTI_PANEL, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsSc2ApiActionUiCargoPanelUnload() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithCargoPanelUnload()); assertThatCorrectActionIsConverted(Action.CARGO_PANEL_UNLOAD, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsSc2ApiActionUiProductionPanelRemoveFromQueue() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithProductionPanelRemoveFromQueue()); assertThatCorrectActionIsConverted(Action.PRODUCTION_PANEL_REMOVE_FROM_QUEUE, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsSc2ApiActionUiToggleAutocast() { ActionUi actionUi = ActionUi.from(sc2ApiActionUiWithToggleAutocast()); assertThatCorrectActionIsConverted(Action.TOGGLE_AUTOCAST, actionUi); } | public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } } | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... | ActionUi implements Sc2ApiSerializable<Ui.ActionUI> { public static ActionUi from(Ui.ActionUI sc2ApiActionUi) { require("sc2api action ui", sc2ApiActionUi); return new ActionUi(sc2ApiActionUi); } private ActionUi(Ui.ActionUI sc2ApiActionUi); private ActionUi(ActionUiControlGroup controlGroup); private ActionUi(Actio... |
@Test void convertsAllFieldsFromSc2ApiUnit() { assertThatAllFieldsAreConverted(AbilityData.from(sc2ApiAbilityData())); } | public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... |
@Test void throwsExceptionWhenExecutablePathIsTooShort() { asWindows(); userHome.newFile(WIN_USER_DIR.resolve("Starcraft II"), EXECUTE_INFO_TXT); assertThatExceptionOfType(StarCraft2ControllerException.class) .isThrownBy(() -> starcraft2Game().withExecutablePath(Paths.get("sc2")).getGameConfiguration()) .withMessage("I... | public static Builder starcraft2Game() { return new Builder(); } | S2Controller extends DefaultSubscriber<Response> { public static Builder starcraft2Game() { return new Builder(); } } | S2Controller extends DefaultSubscriber<Response> { public static Builder starcraft2Game() { return new Builder(); } private S2Controller(Config config); } | S2Controller extends DefaultSubscriber<Response> { public static Builder starcraft2Game() { return new Builder(); } private S2Controller(Config config); static Builder starcraft2Game(); S2Controller untilReady(); void stop(); boolean stopAndWait(); boolean stopAndWait(long timeoutInMillis); void isInState(GameStatus e... | S2Controller extends DefaultSubscriber<Response> { public static Builder starcraft2Game() { return new Builder(); } private S2Controller(Config config); static Builder starcraft2Game(); S2Controller untilReady(); void stop(); boolean stopAndWait(); boolean stopAndWait(long timeoutInMillis); void isInState(GameStatus e... |
@Test void throwsExceptionWhenSc2ApiActionUiSelectArmyIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionUiSelectArmy.from(nothing())) .withMessage("sc2api action ui select army is required"); } | public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } } | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } private ActionUiSelectArmy(Builder builde... | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } private ActionUiSelectArmy(Builder builde... | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } private ActionUiSelectArmy(Builder builde... |
@Test void convertsSc2ApiActionUiSelectArmyToActionUiSelectArmy() { assertThatAllFieldsAreConverted(ActionUiSelectArmy.from(sc2ApiActionUiSelectArmy())); } | public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } } | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } private ActionUiSelectArmy(Builder builde... | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } private ActionUiSelectArmy(Builder builde... | ActionUiSelectArmy implements Sc2ApiSerializable<Ui.ActionSelectArmy> { public static ActionUiSelectArmy from(Ui.ActionSelectArmy sc2ApiActionSelectArmy) { require("sc2api action ui select army", sc2ApiActionSelectArmy); return new ActionUiSelectArmy(sc2ApiActionSelectArmy); } private ActionUiSelectArmy(Builder builde... |
@Test void throwsExceptionWhenSc2ApiActionUiToggleAutocastIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionUiToggleAutocast.from(nothing())) .withMessage("sc2api action ui toggle autocast is required"); } | public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } } | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } privat... | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } privat... | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } privat... |
@Test void convertsSc2ApiActionUiToggleAutocastToActionUiToggleAutocast() { assertThatAllFieldsAreConverted(ActionUiToggleAutocast.from(sc2ApiActionUiToggleAutocast())); } | public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } } | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } privat... | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } privat... | ActionUiToggleAutocast implements Sc2ApiSerializable<Ui.ActionToggleAutocast> { public static ActionUiToggleAutocast from(Ui.ActionToggleAutocast sc2ApiActionToggleAutocast) { require("sc2api action ui toggle autocast", sc2ApiActionToggleAutocast); return new ActionUiToggleAutocast(sc2ApiActionToggleAutocast); } privat... |
@Test void throwsExceptionWhenSc2ApiActionErrorIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionError.from(nothing())) .withMessage("sc2api action error is required"); } | public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); static ActionError from(Sc2Api.ActionError sc2ApiAction... | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); static ActionError from(Sc2Api.ActionError sc2ApiAction... |
@Test void convertsSc2ApiActionErrorToActionError() { assertThatAllFieldsAreConverted(ActionError.from(sc2ApiActionError())); } | public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); static ActionError from(Sc2Api.ActionError sc2ApiAction... | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); static ActionError from(Sc2Api.ActionError sc2ApiAction... |
@Test void throwsExceptionWhenActionResultIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionError.from(without( () -> sc2ApiActionError().toBuilder(), Sc2Api.ActionError.Builder::clearResult).build())) .withMessage("action result is required"); } | public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); } | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); static ActionError from(Sc2Api.ActionError sc2ApiAction... | ActionError implements Serializable { public static ActionError from(Sc2Api.ActionError sc2ApiActionError) { require("sc2api action error", sc2ApiActionError); return new ActionError(sc2ApiActionError); } private ActionError(Sc2Api.ActionError sc2ApiActionError); static ActionError from(Sc2Api.ActionError sc2ApiAction... |
@Test void throwsExceptionWhenSc2ApiActionRawCameraMoveIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawCameraMove.from(nothing())) .withMessage("sc2api action raw camera move is required"); } | public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } } | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } private ActionRawCam... | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } private ActionRawCam... | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } private ActionRawCam... |
@Test void convertsSc2ApiActionRawCameraMoveToActionRawCameraMove() { assertThatAllFieldsAreConverted(ActionRawCameraMove.from(sc2ApiActionRawCameraMove())); } | public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } } | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } private ActionRawCam... | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } private ActionRawCam... | ActionRawCameraMove implements Sc2ApiSerializable<Raw.ActionRawCameraMove> { public static ActionRawCameraMove from(Raw.ActionRawCameraMove sc2ApiActionRawCameraMove) { require("sc2api action raw camera move", sc2ApiActionRawCameraMove); return new ActionRawCameraMove(sc2ApiActionRawCameraMove); } private ActionRawCam... |
@Test void throwsExceptionWhenSc2ApiActionRawIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRaw.from(nothing())) .withMessage("sc2api action raw is required"); } | public static ActionRaw from(Raw.ActionRaw sc2ApiActionRaw) { require("sc2api action raw", sc2ApiActionRaw); return new ActionRaw(sc2ApiActionRaw); } | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { public static ActionRaw from(Raw.ActionRaw sc2ApiActionRaw) { require("sc2api action raw", sc2ApiActionRaw); return new ActionRaw(sc2ApiActionRaw); } } | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { public static ActionRaw from(Raw.ActionRaw sc2ApiActionRaw) { require("sc2api action raw", sc2ApiActionRaw); return new ActionRaw(sc2ApiActionRaw); } private ActionRaw(Raw.ActionRaw sc2ApiActionRaw); private ActionRaw(ActionRawU... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { public static ActionRaw from(Raw.ActionRaw sc2ApiActionRaw) { require("sc2api action raw", sc2ApiActionRaw); return new ActionRaw(sc2ApiActionRaw); } private ActionRaw(Raw.ActionRaw sc2ApiActionRaw); private ActionRaw(ActionRawU... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { public static ActionRaw from(Raw.ActionRaw sc2ApiActionRaw) { require("sc2api action raw", sc2ApiActionRaw); return new ActionRaw(sc2ApiActionRaw); } private ActionRaw(Raw.ActionRaw sc2ApiActionRaw); private ActionRaw(ActionRawU... |
@Test void throwsExceptionWhenAbilityIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(without( () -> sc2ApiAbilityData().toBuilder(), Data.AbilityData.Builder::clearAbilityId).build())) .withMessage("ability is required"); } | public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... |
@Test void serializesToSc2ApiActionRawWithToggleAutocast() { Raw.ActionRaw sc2ApiActionRaw = actionRawWithToggleAutocast().toSc2Api(); assertThat(sc2ApiActionRaw.hasToggleAutocast()).as("sc2api action raw: case of action is toggle autocast") .isTrue(); assertThat(sc2ApiActionRaw.hasCameraMove()).as("sc2api action raw: ... | @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map(ActionRawCameraMove::toSc2Api).ifPresent(aSc2ApiActionRaw::setCameraMove); getToggleAutoc... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... |
@Test void serializesToSc2ApiActionRawWithUnitCommand() { Raw.ActionRaw sc2ApiActionRaw = actionRawWithUnitCommand().toSc2Api(); assertThat(sc2ApiActionRaw.hasToggleAutocast()).as("sc2api action raw: case of action is toggle autocast") .isFalse(); assertThat(sc2ApiActionRaw.hasCameraMove()).as("sc2api action raw: case ... | @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map(ActionRawCameraMove::toSc2Api).ifPresent(aSc2ApiActionRaw::setCameraMove); getToggleAutoc... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... |
@Test void serializesToSc2ApiActionRawWithCameraMove() { Raw.ActionRaw sc2ApiActionRaw = actionRawWithCameraMove().toSc2Api(); assertThat(sc2ApiActionRaw.hasToggleAutocast()).as("sc2api action raw: case of action is toggle autocast") .isFalse(); assertThat(sc2ApiActionRaw.hasCameraMove()).as("sc2api action raw: case of... | @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map(ActionRawCameraMove::toSc2Api).ifPresent(aSc2ApiActionRaw::setCameraMove); getToggleAutoc... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public Raw.ActionRaw toSc2Api() { Raw.ActionRaw.Builder aSc2ApiActionRaw = Raw.ActionRaw.newBuilder(); getUnitCommand().map(ActionRawUnitCommand::toSc2Api).ifPresent(aSc2ApiActionRaw::setUnitCommand); getCameraMove().map... |
@Test void createsCopyWithGeneralizedAbility() { ActionRaw actionRawWithCameraMove = actionRawWithCameraMove(); ActionRaw actionRawWithToggleAutocast = actionRawWithToggleAutocast(); ActionRaw actionRawWithUnitCommand = actionRawWithUnitCommand(); UnaryOperator<Ability> generalize = ability -> Abilities.ATTACK_REDIRECT... | @Override public ActionRaw generalizeAbility(UnaryOperator<Ability> generalize) { Optional<ActionRawUnitCommand> commandUnit = getUnitCommand(); Optional<ActionRawCameraMove> commandCamera = getCameraMove(); Optional<ActionRawToggleAutocast> commandAutocast = getToggleAutocast(); if (commandUnit.isPresent()) { return A... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public ActionRaw generalizeAbility(UnaryOperator<Ability> generalize) { Optional<ActionRawUnitCommand> commandUnit = getUnitCommand(); Optional<ActionRawCameraMove> commandCamera = getCameraMove(); Optional<ActionRawTogg... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public ActionRaw generalizeAbility(UnaryOperator<Ability> generalize) { Optional<ActionRawUnitCommand> commandUnit = getUnitCommand(); Optional<ActionRawCameraMove> commandCamera = getCameraMove(); Optional<ActionRawTogg... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public ActionRaw generalizeAbility(UnaryOperator<Ability> generalize) { Optional<ActionRawUnitCommand> commandUnit = getUnitCommand(); Optional<ActionRawCameraMove> commandCamera = getCameraMove(); Optional<ActionRawTogg... | ActionRaw implements Sc2ApiSerializable<Raw.ActionRaw>, GeneralizableAbility<ActionRaw> { @Override public ActionRaw generalizeAbility(UnaryOperator<Ability> generalize) { Optional<ActionRawUnitCommand> commandUnit = getUnitCommand(); Optional<ActionRawCameraMove> commandCamera = getCameraMove(); Optional<ActionRawTogg... |
@Test void throwsExceptionWhenSc2ApiActionRawUnitCommandIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawUnitCommand.from(nothing())) .withMessage("sc2api action raw unit command is required"); } | public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand(sc2ApiActionRawUnitCommand); } | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... |
@Test void convertsSc2ApiActionRawUnitCommandToActionRawUnitCommand() { assertThatAllFieldsAreConverted(ActionRawUnitCommand.from(sc2ApiActionRawUnitCommand())); } | public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand(sc2ApiActionRawUnitCommand); } | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... |
@Test void throwsExceptionWhenAbilityIdIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawUnitCommand.from(sc2ApiActionRawUnitCommandWithoutAbilityId())) .withMessage("ability id is required"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -... | public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand(sc2ApiActionRawUnitCommand); } | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... |
@Test void throwsExceptionIfUnitTagSetIsEmpty() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawUnitCommand.from(without( () -> sc2ApiActionRawUnitCommand().toBuilder(), Raw.ActionRawUnitCommand.Builder::clearUnitTags).build())) .withMessage("unit tag list is required"); assertTha... | public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand(sc2ApiActionRawUnitCommand); } | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... |
@Test void serializedDefaultValueForQueuedFieldIsNotProvided() { assertThat(defaultUnitCommand().build().toSc2Api().getQueueCommand()) .as("sc2api action raw unit command: default queued value").isFalse(); } | @Override public Raw.ActionRawUnitCommand toSc2Api() { Raw.ActionRawUnitCommand.Builder aSc2ApiUnitCommand = Raw.ActionRawUnitCommand.newBuilder() .setAbilityId(ability.toSc2Api()) .addAllUnitTags(unitTags.stream().map(Tag::toSc2Api).collect(toSet())) .setQueueCommand(queued); getTargetedUnitTag().map(Tag::toSc2Api).if... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { @Override public Raw.ActionRawUnitCommand toSc2Api() { Raw.ActionRawUnitCommand.Builder aSc2ApiUnitCommand = Raw.ActionRawUnitCommand.newBuilder() .setAbilityId(ability.toSc2Api()) .addAllUnitTags(... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { @Override public Raw.ActionRawUnitCommand toSc2Api() { Raw.ActionRawUnitCommand.Builder aSc2ApiUnitCommand = Raw.ActionRawUnitCommand.newBuilder() .setAbilityId(ability.toSc2Api()) .addAllUnitTags(... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { @Override public Raw.ActionRawUnitCommand toSc2Api() { Raw.ActionRawUnitCommand.Builder aSc2ApiUnitCommand = Raw.ActionRawUnitCommand.newBuilder() .setAbilityId(ability.toSc2Api()) .addAllUnitTags(... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { @Override public Raw.ActionRawUnitCommand toSc2Api() { Raw.ActionRawUnitCommand.Builder aSc2ApiUnitCommand = Raw.ActionRawUnitCommand.newBuilder() .setAbilityId(ability.toSc2Api()) .addAllUnitTags(... |
@Test void serializesOnlyRecentlyAddedTarget() { assertCorrectTarget(fullAccessTo(defaultUnitCommand().target(Tag.from(UNIT_TAG))) .target(Point2d.of(10, 20)).build()); assertCorrectTargetAfterOrderChange(fullAccessTo(defaultUnitCommand().target(Point2d.of(10, 20))) .target(Tag.from(UNIT_TAG)).build()); } | public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand(sc2ApiActionRawUnitCommand); } | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... | ActionRawUnitCommand implements Sc2ApiSerializable<Raw.ActionRawUnitCommand>, GeneralizableAbility<ActionRawUnitCommand> { public static ActionRawUnitCommand from(Raw.ActionRawUnitCommand sc2ApiActionRawUnitCommand) { require("sc2api action raw unit command", sc2ApiActionRawUnitCommand); return new ActionRawUnitCommand... |
@Test void throwsExceptionWhenLinkNameIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(without( () -> sc2ApiAbilityData().toBuilder(), Data.AbilityData.Builder::clearLinkName).build())) .withMessage("link name is required"); } | public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... |
@Test void throwsExceptionWhenSc2ApiActionRawToggleAutocastIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ActionRawToggleAutocast.from(nothing())) .withMessage("sc2api action raw toggle autocast is required"); } | public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return new ActionRawToggleAutocast(sc2ApiActionRawToggleAutocast); } | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... |
@Test void convertsSc2ApiActionRawToggleAutocastToActionRawToggleAutocast() { assertThatAllFieldsAreConverted(ActionRawToggleAutocast.from(sc2ApiActionRawToggleAutocast())); } | public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return new ActionRawToggleAutocast(sc2ApiActionRawToggleAutocast); } | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... | ActionRawToggleAutocast implements Sc2ApiSerializable<Raw.ActionRawToggleAutocast>, GeneralizableAbility<ActionRawToggleAutocast> { public static ActionRawToggleAutocast from(Raw.ActionRawToggleAutocast sc2ApiActionRawToggleAutocast) { require("sc2api action raw toggle autocast", sc2ApiActionRawToggleAutocast); return ... |
@Test void throwsExceptionWhenSc2ApiActionIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> Action.from(nothing())) .withMessage("sc2api action is required"); } | public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } } | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } private Action(Builder builder); private Action(Sc2Api.Action sc2ApiAction); } | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } private Action(Builder builder); private Action(Sc2Api.Action sc2ApiAction); static ActionSyntax action(); static Action from(Sc2Api.... | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } private Action(Builder builder); private Action(Sc2Api.Action sc2ApiAction); static ActionSyntax action(); static Action from(Sc2Api.... |
@Test void convertsAllFieldsFromSc2ApiAction() { assertThatAllFieldsAreConverted(Action.from(sc2ApiAction())); } | public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } } | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } private Action(Builder builder); private Action(Sc2Api.Action sc2ApiAction); } | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } private Action(Builder builder); private Action(Sc2Api.Action sc2ApiAction); static ActionSyntax action(); static Action from(Sc2Api.... | Action implements Sc2ApiSerializable<Sc2Api.Action> { public static Action from(Sc2Api.Action sc2ApiAction) { require("sc2api action", sc2ApiAction); return new Action(sc2ApiAction); } private Action(Builder builder); private Action(Sc2Api.Action sc2ApiAction); static ActionSyntax action(); static Action from(Sc2Api.... |
@Test void throwsExceptionWhenQueriesAreEmpty() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ((RequestQuery.Builder) query()).build()) .withMessage("one of query is required"); } | public static RequestQuerySyntax query() { return new Builder(); } | RequestQuery extends Request { public static RequestQuerySyntax query() { return new Builder(); } } | RequestQuery extends Request { public static RequestQuerySyntax query() { return new Builder(); } private RequestQuery(Builder builder); } | RequestQuery extends Request { public static RequestQuerySyntax query() { return new Builder(); } private RequestQuery(Builder builder); static RequestQuerySyntax query(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<QueryPathing> getPathings(); List<QueryAvailableAbilities> getAbil... | RequestQuery extends Request { public static RequestQuerySyntax query() { return new Builder(); } private RequestQuery(Builder builder); static RequestQuerySyntax query(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<QueryPathing> getPathings(); List<QueryAvailableAbilities> getAbil... |
@Test void throwsExceptionWhenReplayCaseIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> fullAccessTo(replayInfo()).build()) .withMessage("replay case is required"); } | public static RequestReplayInfoSyntax replayInfo() { return new Builder(); } | RequestReplayInfo extends Request { public static RequestReplayInfoSyntax replayInfo() { return new Builder(); } } | RequestReplayInfo extends Request { public static RequestReplayInfoSyntax replayInfo() { return new Builder(); } private RequestReplayInfo(Builder builder); } | RequestReplayInfo extends Request { public static RequestReplayInfoSyntax replayInfo() { return new Builder(); } private RequestReplayInfo(Builder builder); static RequestReplayInfoSyntax replayInfo(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Path> getReplayPath(); Optional<... | RequestReplayInfo extends Request { public static RequestReplayInfoSyntax replayInfo() { return new Builder(); } private RequestReplayInfo(Builder builder); static RequestReplayInfoSyntax replayInfo(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Path> getReplayPath(); Optional<... |
@Test void serializesDefaultAbilityValueIfNotSet() { Sc2Api.RequestData aSc2ApiRequestData = defaultRequestData().toSc2Api().getData(); assertThat(aSc2ApiRequestData.hasAbilityId()).as("data: ability value is set").isTrue(); assertThat(aSc2ApiRequestData.getAbilityId()).as("data: default ability value").isFalse(); } | @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... |
@Test void serializesDefaultBuffValueIfNotSet() { Sc2Api.RequestData aSc2ApiRequestData = defaultRequestData().toSc2Api().getData(); assertThat(aSc2ApiRequestData.hasBuffId()).as("data: buff value is set").isTrue(); assertThat(aSc2ApiRequestData.getBuffId()).as("data: default buff value").isFalse(); } | @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... |
@Test void serializesDefaultEffectValueIfNotSet() { Sc2Api.RequestData aSc2ApiRequestData = defaultRequestData().toSc2Api().getData(); assertThat(aSc2ApiRequestData.hasEffectId()).as("data: effect value is set").isTrue(); assertThat(aSc2ApiRequestData.getEffectId()).as("data: default effect value").isFalse(); } | @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... |
@Test void serializesDefaultUnitTypeValueIfNotSet() { Sc2Api.RequestData aSc2ApiRequestData = defaultRequestData().toSc2Api().getData(); assertThat(aSc2ApiRequestData.hasUnitTypeId()).as("data: unit type value is set").isTrue(); assertThat(aSc2ApiRequestData.getUnitTypeId()).as("data: default unit type value").isFalse(... | @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... |
@Test void throwsExceptionWhenLinkIndexIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> AbilityData.from(without( () -> sc2ApiAbilityData().toBuilder(), Data.AbilityData.Builder::clearLinkIndex).build())) .withMessage("link index is required"); } | public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); } | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... | AbilityData implements Serializable { public static AbilityData from(Data.AbilityData sc2ApiAbilityData) { require("sc2api ability data", sc2ApiAbilityData); return new AbilityData(sc2ApiAbilityData); } private AbilityData(Data.AbilityData sc2ApiAbilityData); static AbilityData from(Data.AbilityData sc2ApiAbilityData)... |
@Test void serializesDefaultUpgradeValueIfNotSet() { Sc2Api.RequestData aSc2ApiRequestData = defaultRequestData().toSc2Api().getData(); assertThat(aSc2ApiRequestData.hasUpgradeId()).as("data: upgrade value is set").isTrue(); assertThat(aSc2ApiRequestData.getUpgradeId()).as("data: default upgrade value").isFalse(); } | @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } } | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... | RequestData extends Request { @Override public Sc2Api.Request toSc2Api() { return Sc2Api.Request.newBuilder() .setData(Sc2Api.RequestData.newBuilder() .setAbilityId(ability) .setBuffId(buff) .setEffectId(effect) .setUnitTypeId(unitType) .setUpgradeId(upgrade) .build()) .build(); } private RequestData(Builder builder);... |
@Test void throwsExceptionWhenParticipantCaseIsNotSet() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> fullAccessTo(joinGame()).build()) .withMessage("participant case is required"); } | public static RequestJoinGameSyntax joinGame() { return new Builder(); } | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } } | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } private RequestJoinGame(Builder builder); } | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } private RequestJoinGame(Builder builder); static RequestJoinGameSyntax joinGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Race> getRace(); Optional<Observer> getObser... | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } private RequestJoinGame(Builder builder); static RequestJoinGameSyntax joinGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Race> getRace(); Optional<Observer> getObser... |
@Test void throwsExceptionIfInterfaceOptionsAreNotSet() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> joinGame().as(Race.RANDOM).use((InterfaceOptions) nothing()).build()) .withMessage("interface options are required"); } | public static RequestJoinGameSyntax joinGame() { return new Builder(); } | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } } | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } private RequestJoinGame(Builder builder); } | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } private RequestJoinGame(Builder builder); static RequestJoinGameSyntax joinGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Race> getRace(); Optional<Observer> getObser... | RequestJoinGame extends Request { public static RequestJoinGameSyntax joinGame() { return new Builder(); } private RequestJoinGame(Builder builder); static RequestJoinGameSyntax joinGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Race> getRace(); Optional<Observer> getObser... |
@Test void throwsExceptionWhenObserverActionListIsEmpty() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ((RequestObserverAction.Builder) observerActions()).build()) .withMessage("action list is required"); } | public static RequestObserverActionSyntax observerActions() { return new Builder(); } | RequestObserverAction extends Request { public static RequestObserverActionSyntax observerActions() { return new Builder(); } } | RequestObserverAction extends Request { public static RequestObserverActionSyntax observerActions() { return new Builder(); } private RequestObserverAction(Builder builder); } | RequestObserverAction extends Request { public static RequestObserverActionSyntax observerActions() { return new Builder(); } private RequestObserverAction(Builder builder); static RequestObserverActionSyntax observerActions(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<ObserverAc... | RequestObserverAction extends Request { public static RequestObserverActionSyntax observerActions() { return new Builder(); } private RequestObserverAction(Builder builder); static RequestObserverActionSyntax observerActions(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<ObserverAc... |
@Test void throwsExceptionWhenActionListIsEmpty() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ((RequestAction.Builder) actions()).build()) .withMessage("action list is required"); } | public static RequestActionSyntax actions() { return new Builder(); } | RequestAction extends Request { public static RequestActionSyntax actions() { return new Builder(); } } | RequestAction extends Request { public static RequestActionSyntax actions() { return new Builder(); } private RequestAction(Builder builder); } | RequestAction extends Request { public static RequestActionSyntax actions() { return new Builder(); } private RequestAction(Builder builder); static RequestActionSyntax actions(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<Action> getActions(); @Override boolean equals(Object o); ... | RequestAction extends Request { public static RequestActionSyntax actions() { return new Builder(); } private RequestAction(Builder builder); static RequestActionSyntax actions(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<Action> getActions(); @Override boolean equals(Object o); ... |
@Test void throwsExceptionWhenMapIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> saveMap().build()) .withMessage("map is required"); } | public static Builder saveMap() { return new Builder(); } | RequestSaveMap extends Request { public static Builder saveMap() { return new Builder(); } } | RequestSaveMap extends Request { public static Builder saveMap() { return new Builder(); } private RequestSaveMap(Builder builder); } | RequestSaveMap extends Request { public static Builder saveMap() { return new Builder(); } private RequestSaveMap(Builder builder); static Builder saveMap(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); LocalMap getMap(); @Override boolean equals(Object o); @Override int hashCode(); @Ove... | RequestSaveMap extends Request { public static Builder saveMap() { return new Builder(); } private RequestSaveMap(Builder builder); static Builder saveMap(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); LocalMap getMap(); @Override boolean equals(Object o); @Override int hashCode(); @Ove... |
@Test void throwsExceptionWhenMapIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ((RequestDebug.Builder) debug()).build()) .withMessage("command list is required"); } | public static RequestDebugSyntax debug() { return new Builder(); } | RequestDebug extends Request { public static RequestDebugSyntax debug() { return new Builder(); } } | RequestDebug extends Request { public static RequestDebugSyntax debug() { return new Builder(); } private RequestDebug(Builder builder); } | RequestDebug extends Request { public static RequestDebugSyntax debug() { return new Builder(); } private RequestDebug(Builder builder); static RequestDebugSyntax debug(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<DebugCommand> getCommands(); @Override boolean equals(Object o); @... | RequestDebug extends Request { public static RequestDebugSyntax debug() { return new Builder(); } private RequestDebug(Builder builder); static RequestDebugSyntax debug(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); List<DebugCommand> getCommands(); @Override boolean equals(Object o); @... |
@Test void throwsExceptionWhenMapDataIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> fullAccessTo(createGame()).build()) .withMessage("one of map data is required"); } | public static RequestCreateGameSyntax createGame() { return new Builder(); } | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } } | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } private RequestCreateGame(Builder builder); } | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } private RequestCreateGame(Builder builder); static RequestCreateGameSyntax createGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); boolean isDisableFog(); boolean isRealTim... | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } private RequestCreateGame(Builder builder); static RequestCreateGameSyntax createGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); boolean isDisableFog(); boolean isRealTim... |
@Test void throwsExceptionWhenPlayerSetupIsEmpty() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> createGame().onBattlenetMap(BattlenetMap.of(BATTLENET_MAP_NAME)).build()) .withMessage("player setup is required"); } | public static RequestCreateGameSyntax createGame() { return new Builder(); } | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } } | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } private RequestCreateGame(Builder builder); } | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } private RequestCreateGame(Builder builder); static RequestCreateGameSyntax createGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); boolean isDisableFog(); boolean isRealTim... | RequestCreateGame extends Request { public static RequestCreateGameSyntax createGame() { return new Builder(); } private RequestCreateGame(Builder builder); static RequestCreateGameSyntax createGame(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); boolean isDisableFog(); boolean isRealTim... |
@Test void serializesDefaultValueForCountWhenNotSet() { assertThat(requestStepWithDefaultValues().getCount()).as("count default value") .isEqualTo(DEFAULT_GAME_LOOP_COUNT); } | public int getCount() { return count; } | RequestStep extends Request { public int getCount() { return count; } } | RequestStep extends Request { public int getCount() { return count; } private RequestStep(Builder builder); } | RequestStep extends Request { public int getCount() { return count; } private RequestStep(Builder builder); static RequestStepSyntax nextStep(); int getCount(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toS... | RequestStep extends Request { public int getCount() { return count; } private RequestStep(Builder builder); static RequestStepSyntax nextStep(); int getCount(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toS... |
@Test void throwsExceptionWhenSc2ApiUpgradeDataIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UpgradeData.from(nothing())) .withMessage("sc2api upgrade data is required"); } | public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... |
@Test void throwsExceptionWhenCountValueIsLowerThanOne() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> nextStep().withCount(0)) .withMessage("count must be greater than 0"); } | public static RequestStepSyntax nextStep() { return new Builder(); } | RequestStep extends Request { public static RequestStepSyntax nextStep() { return new Builder(); } } | RequestStep extends Request { public static RequestStepSyntax nextStep() { return new Builder(); } private RequestStep(Builder builder); } | RequestStep extends Request { public static RequestStepSyntax nextStep() { return new Builder(); } private RequestStep(Builder builder); static RequestStepSyntax nextStep(); int getCount(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); @Override boolean equals(Object o); @Override int has... | RequestStep extends Request { public static RequestStepSyntax nextStep() { return new Builder(); } private RequestStep(Builder builder); static RequestStepSyntax nextStep(); int getCount(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); @Override boolean equals(Object o); @Override int has... |
@Test void throwsExceptionWhenReplayCaseIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> fullAccessTo(startReplay()).build()) .withMessage("one of replay case is required"); } | public static RequestStartReplaySyntax startReplay() { return new Builder(); } | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } } | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } private RequestStartReplay(Builder builder); } | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } private RequestStartReplay(Builder builder); static RequestStartReplaySyntax startReplay(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Path> getReplayPath(); Opt... | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } private RequestStartReplay(Builder builder); static RequestStartReplaySyntax startReplay(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Path> getReplayPath(); Opt... |
@Test void throwsExceptionWhenObservedPlayerIsNotSet() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy( () -> fullAccessTo(startReplay().from(Paths.get(REPLAY_PATH)).use(defaultInterfaces())).build()) .withMessage("observed player is required"); } | public static RequestStartReplaySyntax startReplay() { return new Builder(); } | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } } | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } private RequestStartReplay(Builder builder); } | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } private RequestStartReplay(Builder builder); static RequestStartReplaySyntax startReplay(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Path> getReplayPath(); Opt... | RequestStartReplay extends Request { public static RequestStartReplaySyntax startReplay() { return new Builder(); } private RequestStartReplay(Builder builder); static RequestStartReplaySyntax startReplay(); @Override Sc2Api.Request toSc2Api(); @Override ResponseType responseType(); Optional<Path> getReplayPath(); Opt... |
@Test void serializesDefaultDisableFogValueIfNotSet() { Sc2Api.RequestStartReplay aSc2ApiRequestStartReplay = aRequestStartReplay().build().toSc2Api().getStartReplay(); assertThat(aSc2ApiRequestStartReplay.hasDisableFog()).as("disable fog value is set").isTrue(); assertThat(aSc2ApiRequestStartReplay.getDisableFog()).as... | @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getReplayPath().map(Path::toString).ifPrese... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... |
@Test void serializesDefaultRealtimeValueIfNotSet() { Sc2Api.RequestStartReplay aSc2ApiRequestStartReplay = aRequestStartReplay().build().toSc2Api().getStartReplay(); assertThat(aSc2ApiRequestStartReplay.hasRealtime()).as("realtime value is set").isTrue(); assertThat(aSc2ApiRequestStartReplay.getRealtime()).as("default... | @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getReplayPath().map(Path::toString).ifPrese... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... | RequestStartReplay extends Request { @Override public Sc2Api.Request toSc2Api() { Sc2Api.RequestStartReplay.Builder aSc2ApiRequestStartReplay = Sc2Api.RequestStartReplay.newBuilder() .setOptions(interfaceOptions.toSc2Api()) .setObservedPlayerId(observedPlayerId) .setDisableFog(disableFog) .setRealtime(realtime); getRep... |
@Test void throwsIllegalArgumentExceptionForNullArgumentsOrEmptyErrorListInSc2ApiResponse() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseError.from(nothing())) .withMessage("provided argument doesn't have error response"); assertThatExceptionOfType(IllegalArgumentException.class... | public static ResponseError from(Sc2Api.Response sc2ApiResponse) { if (!isSet(sc2ApiResponse) || sc2ApiResponse.getErrorCount() == 0) { throw new IllegalArgumentException("provided argument doesn't have error response"); } return new ResponseError(sc2ApiResponse.getErrorList(), sc2ApiResponse.getStatus(), sc2ApiRespons... | ResponseError extends Response { public static ResponseError from(Sc2Api.Response sc2ApiResponse) { if (!isSet(sc2ApiResponse) || sc2ApiResponse.getErrorCount() == 0) { throw new IllegalArgumentException("provided argument doesn't have error response"); } return new ResponseError(sc2ApiResponse.getErrorList(), sc2ApiRe... | ResponseError extends Response { public static ResponseError from(Sc2Api.Response sc2ApiResponse) { if (!isSet(sc2ApiResponse) || sc2ApiResponse.getErrorCount() == 0) { throw new IllegalArgumentException("provided argument doesn't have error response"); } return new ResponseError(sc2ApiResponse.getErrorList(), sc2ApiRe... | ResponseError extends Response { public static ResponseError from(Sc2Api.Response sc2ApiResponse) { if (!isSet(sc2ApiResponse) || sc2ApiResponse.getErrorCount() == 0) { throw new IllegalArgumentException("provided argument doesn't have error response"); } return new ResponseError(sc2ApiResponse.getErrorList(), sc2ApiRe... | ResponseError extends Response { public static ResponseError from(Sc2Api.Response sc2ApiResponse) { if (!isSet(sc2ApiResponse) || sc2ApiResponse.getErrorCount() == 0) { throw new IllegalArgumentException("provided argument doesn't have error response"); } return new ResponseError(sc2ApiResponse.getErrorList(), sc2ApiRe... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveDebug() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseDebug.from(nothing())) .withMessage("provided argument doesn't have debug response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseD... | public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } } | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private Res... | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private Res... | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private Res... |
@Test void convertsSc2ApiResponseDebugToResponseDebug() { ResponseDebug responseDebug = ResponseDebug.from(sc2ApiResponseWithDebug()); assertThat(responseDebug).as("converted response debug").isNotNull(); assertThat(responseDebug.getType()).as("type of debug response") .isEqualTo(ResponseType.DEBUG); assertThat(respons... | public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } } | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private Res... | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private Res... | ResponseDebug extends Response { public static ResponseDebug from(Sc2Api.Response sc2ApiResponse) { if (!hasDebugResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have debug response"); } return new ResponseDebug(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } private Res... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveGameInfo() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseGameInfo.from(nothing())) .withMessage("provided argument doesn't have game info response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() ->... | public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... |
@Test void throwsExceptionWhenMapNameIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseGameInfo.from( sc2ApiGameInfoWithout(Sc2Api.ResponseGameInfo.Builder::clearMapName))) .withMessage("map name is required"); } | public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... |
@Test void convertsAllFieldsFromSc2ApiUnit() { assertThatAllFieldsAreConverted(UpgradeData.from(sc2ApiUpgradeData())); } | public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... |
@Test void throwsExceptionWhenInterfaceOptionsIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseGameInfo.from( sc2ApiGameInfoWithout(Sc2Api.ResponseGameInfo.Builder::clearOptions))) .withMessage("interface options is required"); } | public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... |
@Test void throwsExceptionWhenPlayersInfoIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseGameInfo.from( sc2ApiGameInfoWithout(Sc2Api.ResponseGameInfo.Builder::clearPlayerInfo))) .withMessage("players info is required"); } | public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... |
@Test void convertsSc2ApiResponseGameInfoToResponseGameInfo() { assertThatAllFieldsAreProperlyConverted(ResponseGameInfo.from(sc2ApiResponseWithGameInfo())); } | public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... | ResponseGameInfo extends Response { public static ResponseGameInfo from(Sc2Api.Response sc2ApiResponse) { if (!hasGameInfoResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have game info response"); } return new ResponseGameInfo(sc2ApiResponse.getGameInfo(), sc2ApiResponse.getSta... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveObserverAction() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseObserverAction.from(nothing())) .withMessage("provided argument doesn't have observer action response"); assertThatExceptionOfType(IllegalArgumentException.class)... | public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... |
@Test void convertsSc2ApiResponseObserverActionToResponseObserverAction() { ResponseObserverAction responseObserverAction = ResponseObserverAction.from(sc2ApiResponseWithObserverAction()); assertThat(responseObserverAction).as("converted response observer action").isNotNull(); assertThat(responseObserverAction.getType(... | public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... | ResponseObserverAction extends Response { public static ResponseObserverAction from(Sc2Api.Response sc2ApiResponse) { if (!hasObserverActionResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have observer action response"); } return new ResponseObserverAction(sc2ApiResponse.getSta... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveCreateGame() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseCreateGame.from(nothing())) .withMessage("provided argument doesn't have create game response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy... | public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... |
@Test void convertsSc2ApiResponseCreateGameToResponseCreateGame() { assertThatResponseCreateGameDoesNotHaveError(ResponseCreateGame.from(sc2ApiResponseWithCreateGame())); } | public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... |
@Test void throwsExceptionWhenResponseCreateGameErrorIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseCreateGame.Error.from(nothing())) .withMessage("sc2api response create game error is required"); } | public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... |
@Test void convertsSc2ApiResponseCreateGameWithErrorToResponseCreateGame() { ResponseCreateGame responseCreateGame = ResponseCreateGame.from(sc2ApiResponseWithCreateGameWithError()); assertThatResponseIsInValidState(responseCreateGame); assertThatErrorsAreMapped(responseCreateGame); } | public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... | ResponseCreateGame extends Response { public static ResponseCreateGame from(Sc2Api.Response sc2ApiResponse) { if (!hasCreateGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have create game response"); } return new ResponseCreateGame( sc2ApiResponse.getCreateGame(), sc2ApiRe... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveQuitGame() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseQuitGame.from(nothing())) .withMessage("provided argument doesn't have quit response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> Resp... | public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } } | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } priva... | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } priva... | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } priva... |
@Test void throwsExceptionWhenUpgradeIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UpgradeData.from(without( () -> sc2ApiUpgradeData().toBuilder(), Data.UpgradeData.Builder::clearUpgradeId).build())) .withMessage("upgrade is required"); } | public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... |
@Test void convertsSc2ApiResponseQuitGameToResponseQuitGame() { ResponseQuitGame responseQuitGame = ResponseQuitGame.from(sc2ApiResponseWithQuit()); assertThat(responseQuitGame).as("converted response quit game").isNotNull(); assertThat(responseQuitGame.getType()).as("type of quit game response") .isEqualTo(ResponseTyp... | public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } } | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } priva... | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } priva... | ResponseQuitGame extends Response { public static ResponseQuitGame from(Sc2Api.Response sc2ApiResponse) { if (!hasQuitResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quit response"); } return new ResponseQuitGame(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } priva... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveAvailableMaps() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseAvailableMaps.from(nothing())) .withMessage("provided argument doesn't have available maps response"); assertThatExceptionOfType(IllegalArgumentException.class) .i... | public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailableMaps(), sc2ApiResponse.getStatus(), sc2... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... |
@Test void hasEmptySetOfMapsForEmptySc2ApiResponseAvailableMaps() { ResponseAvailableMaps responseAvailableMaps = ResponseAvailableMaps.from(emptySc2ApiResponseWithAvailableMaps()); assertThatAllFieldsAreProperlyConverted( responseAvailableMaps, new ExpectedResponseData().withResponseStatus(GameStatus.QUIT)); } | public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailableMaps(), sc2ApiResponse.getStatus(), sc2... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... |
@Test void convertsSc2ApiResponseAvailableMapsToResponseAvailableMaps() { ResponseAvailableMaps responseAvailableMaps = ResponseAvailableMaps.from(sc2ApiResponseWithAvailableMaps()); assertThatAllFieldsAreProperlyConverted( responseAvailableMaps, new ExpectedResponseData() .withResponseStatus(GameStatus.IN_GAME) .withB... | public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailableMaps(), sc2ApiResponse.getStatus(), sc2... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... | ResponseAvailableMaps extends Response { public static ResponseAvailableMaps from(Sc2Api.Response sc2ApiResponse) { if (!hasAvailableMapsResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have available maps response"); } return new ResponseAvailableMaps( sc2ApiResponse.getAvailab... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveSaveMap() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseSaveMap.from(nothing())) .withMessage("provided argument doesn't have save map response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> Re... | public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... |
@Test void convertsSc2ApiResponseSaveMapToResponseSaveMap() { ResponseSaveMap responseSaveMap = ResponseSaveMap.from(sc2ApiResponseWithSaveMap()); assertThatResponseDoesNotHaveError(responseSaveMap); assertThatResponseIsInValidState(responseSaveMap); } | public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... |
@Test void throwsExceptionWhenResponseSaveMapErrorIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseSaveMap.Error.from(nothing())) .withMessage("sc2api response save map error is required"); } | public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... |
@Test void convertsSc2ApiResponseSaveMapWithErrorToResponseSaveMap() { ResponseSaveMap responseSaveMap = ResponseSaveMap.from(sc2ApiResponseWithSaveMapWithError()); assertThatResponseIsInValidState(responseSaveMap); assertThatErrorIsMapped(responseSaveMap); } | public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... | ResponseSaveMap extends Response { public static ResponseSaveMap from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveMapResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save map response"); } return new ResponseSaveMap(sc2ApiResponse.getSaveMap(), sc2ApiResponse.getStatus(),... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveRestartGame() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseRestartGame.from(nothing())) .withMessage("provided argument doesn't have restart game response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrow... | public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc2ApiResponse.getStatus(), sc2ApiRespons... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... |
@Test void convertsSc2ApiResponseRestartGameToResponseRestartGame() { ResponseRestartGame responseRestartGame = ResponseRestartGame.from(sc2ApiResponseWithRestartGame()); assertThatResponseDoesNotHaveError(responseRestartGame); assertThatResponseIsInValidState(responseRestartGame); } | public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc2ApiResponse.getStatus(), sc2ApiRespons... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... |
@Test void throwsExceptionWhenNameIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> UpgradeData.from(without( () -> sc2ApiUpgradeData().toBuilder(), Data.UpgradeData.Builder::clearName).build())) .withMessage("name is required"); } | public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); } | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... | UpgradeData implements Serializable { public static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData) { require("sc2api upgrade data", sc2ApiUpgradeData); return new UpgradeData(sc2ApiUpgradeData); } private UpgradeData(Data.UpgradeData sc2ApiUpgradeData); static UpgradeData from(Data.UpgradeData sc2ApiUpgradeData)... |
@Test void throwsExceptionWhenResponseRestartGameErrorIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseRestartGame.Error.from(nothing())) .withMessage("sc2api response restart game error is required"); } | public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc2ApiResponse.getStatus(), sc2ApiRespons... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... |
@Test void convertsSc2ApiResponseRestartGameWithErrorToResponseRestartGame() { ResponseRestartGame responseRestartGame = ResponseRestartGame.from(sc2ApiResponseWithRestartGameWithError()); assertThatResponseIsInValidState(responseRestartGame); assertThatErrorsAreMapped(responseRestartGame); } | public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc2ApiResponse.getStatus(), sc2ApiRespons... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... | ResponseRestartGame extends Response { public static ResponseRestartGame from(Sc2Api.Response sc2ApiResponse) { if (!hasRestartGameResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have restart game response"); } return new ResponseRestartGame( sc2ApiResponse.getRestartGame(), sc... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHavePing() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponsePing.from(nothing())) .withMessage("provided argument doesn't have ping response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponsePing... | public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveAllFieldsSet() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponsePing.from( sc2ApiResponsePingWithout(Sc2Api.ResponsePing.Builder::clearGameVersion))) .withMessage("game version is required"); assertThatExceptionOfType(IllegalArg... | public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
@Test void convertsSc2ApiResponsePingToResponsePing() { ResponsePing responsePing = ResponsePing.from(sc2ApiResponseWithPing()); assertThatAllFieldsAreProperlyConverted(responsePing); } | public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponsePing extends Response { public static ResponsePing from(Sc2Api.Response sc2ApiResponse) { if (!hasPingResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have ping response"); } return new ResponsePing(sc2ApiResponse.getPing(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveQuery() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseQuery.from(nothing())) .withMessage("provided argument doesn't have query response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseQ... | public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... |
@Test void convertsSc2ApiResponseQueryToResponseQuery() { assertThatAllFieldsAreProperlyConverted(ResponseQuery.from(sc2ApiResponseWithQuery())); } | public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... | ResponseQuery extends Response { public static ResponseQuery from(Sc2Api.Response sc2ApiResponse) { if (!hasQueryResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have query response"); } return new ResponseQuery(sc2ApiResponse.getQuery(), sc2ApiResponse.getStatus(), sc2ApiRespon... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveData() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseData.from(nothing())) .withMessage("provided argument doesn't have data response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseData... | public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
@Test void convertsSc2ApiResponseDataToResponseData() { assertThatAllFieldsAreProperlyConverted(ResponseData.from(sc2ApiResponseWithData())); } | public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseData extends Response { public static ResponseData from(Sc2Api.Response sc2ApiResponse) { if (!hasDataResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have data response"); } return new ResponseData(sc2ApiResponse.getData(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveSaveReplay() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseSaveReplay.from(nothing())) .withMessage("provided argument doesn't have save replay response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy... | public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... |
@Test void throwsExceptionWhenSc2ApiBuffDataIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> BuffData.from(nothing())) .withMessage("sc2api buff data is required"); } | public static BuffData from(Data.BuffData sc2ApiBuffData) { require("sc2api buff data", sc2ApiBuffData); return new BuffData(sc2ApiBuffData); } | BuffData implements Serializable { public static BuffData from(Data.BuffData sc2ApiBuffData) { require("sc2api buff data", sc2ApiBuffData); return new BuffData(sc2ApiBuffData); } } | BuffData implements Serializable { public static BuffData from(Data.BuffData sc2ApiBuffData) { require("sc2api buff data", sc2ApiBuffData); return new BuffData(sc2ApiBuffData); } private BuffData(Data.BuffData sc2ApiBuffData); } | BuffData implements Serializable { public static BuffData from(Data.BuffData sc2ApiBuffData) { require("sc2api buff data", sc2ApiBuffData); return new BuffData(sc2ApiBuffData); } private BuffData(Data.BuffData sc2ApiBuffData); static BuffData from(Data.BuffData sc2ApiBuffData); Buff getBuff(); String getName(); @Overr... | BuffData implements Serializable { public static BuffData from(Data.BuffData sc2ApiBuffData) { require("sc2api buff data", sc2ApiBuffData); return new BuffData(sc2ApiBuffData); } private BuffData(Data.BuffData sc2ApiBuffData); static BuffData from(Data.BuffData sc2ApiBuffData); Buff getBuff(); String getName(); @Overr... |
@Test void throwsExceptionWhenDataIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseSaveReplay.from(sc2ApiResponseWithSaveReplayWithoutData())) .withMessage("data is required"); } | public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... | ResponseSaveReplay extends Response { public static ResponseSaveReplay from(Sc2Api.Response sc2ApiResponse) { if (!hasSaveReplayResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have save replay response"); } return new ResponseSaveReplay( sc2ApiResponse.getSaveReplay(), sc2ApiRe... |
@Test void throwsExceptionWhenSc2ApiResponseDoesNotHaveQuickSave() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ResponseQuickSave.from(nothing())) .withMessage("provided argument doesn't have quick save response"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(()... | public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
@Test void convertsSc2ApiResponseQuickSaveToResponseQuickSave() { ResponseQuickSave responseQuickSave = ResponseQuickSave.from(sc2ApiResponseWithQuickSave()); assertThat(responseQuickSave).as("converted response quick save").isNotNull(); assertThat(responseQuickSave.getType()).as("type of quick save response").isEqualT... | public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.getId()); } | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... | ResponseQuickSave extends Response { public static ResponseQuickSave from(Sc2Api.Response sc2ApiResponse) { if (!hasQuickSaveResponse(sc2ApiResponse)) { throw new IllegalArgumentException("provided argument doesn't have quick save response"); } return new ResponseQuickSave(sc2ApiResponse.getStatus(), sc2ApiResponse.get... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.