File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
main/java/org/apache/druid/indexing/common/actions
test/java/org/apache/druid/indexing/common/actions Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 2323import com .fasterxml .jackson .annotation .JsonProperty ;
2424import com .fasterxml .jackson .core .type .TypeReference ;
2525import com .google .common .base .Optional ;
26+ import org .apache .druid .error .InvalidInput ;
2627import org .apache .druid .indexer .TaskLocation ;
2728import org .apache .druid .indexing .common .task .Task ;
2829import org .apache .druid .indexing .overlord .TaskRunner ;
@@ -42,6 +43,7 @@ public UpdateLocationAction(
4243 @ JsonProperty ("location" ) TaskLocation location
4344 )
4445 {
46+ InvalidInput .conditionalException (location != null , "No task location specified" );
4547 this .location = location ;
4648 }
4749
Original file line number Diff line number Diff line change 2121
2222import com .fasterxml .jackson .core .JsonProcessingException ;
2323import com .google .common .base .Optional ;
24+ import org .apache .druid .error .DruidException ;
2425import org .apache .druid .indexer .TaskLocation ;
2526import org .apache .druid .indexing .common .task .NoopTask ;
2627import org .apache .druid .indexing .common .task .Task ;
@@ -82,4 +83,13 @@ public void testSerde() throws JsonProcessingException
8283 final TaskAction <?> deserialized = TestHelper .JSON_MAPPER .readValue (json , TaskAction .class );
8384 Assert .assertEquals (original , deserialized );
8485 }
86+
87+ @ Test
88+ public void test_actionWithNullLocation_throwsException ()
89+ {
90+ Assert .assertThrows (
91+ DruidException .class ,
92+ () -> new UpdateLocationAction (null )
93+ );
94+ }
8595}
You can’t perform that action at this time.
0 commit comments