### Question:
JobCoreConfiguration { public static Builder newBuilder(final String jobName, final String cron, final int shardingTotalCount) { return new Builder(jobName, cron, shardingTotalCount); }  static Builder newBuilder(final String jobName, final String cron, final int shardingTotalCount);  }### Answer:
@Test public void assertBuildAllProperties() { JobCoreConfiguration actual = JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3) .shardingItemParameters("0=a,1=b,2=c").jobParameter("param").failover(true).misfire(false).description("desc") .jobProperties("job_exception_handler", IgnoreJobExceptionHandler.class.getName()).build(); assertRequiredProperties(actual); Assert.assertThat(actual.getShardingItemParameters(), Is.is("0=a,1=b,2=c")); Assert.assertThat(actual.getJobParameter(), Is.is("param")); Assert.assertTrue(actual.isFailover()); Assert.assertFalse(actual.isMisfire()); Assert.assertThat(actual.getDescription(), Is.is("desc")); Assert.assertThat(actual.getJobProperties().get(JobProperties.JobPropertiesEnum.JOB_EXCEPTION_HANDLER), Is.is(IgnoreJobExceptionHandler.class.getName())); }
@Test public void assertBuildRequiredProperties() { JobCoreConfiguration actual = JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).build(); assertRequiredProperties(actual); assertDefaultValues(actual); }
@Test public void assertBuildWhenOptionalParametersIsNull() { JobCoreConfiguration actual = JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).shardingItemParameters(null).jobParameter(null).description(null).build(); assertRequiredProperties(actual); assertDefaultValues(actual); }
@Test(expected = IllegalArgumentException.class) public void assertBuildWhenJobNameIsNull() { JobCoreConfiguration.newBuilder(null, "0/1 * * * * ?", 3).build(); }
@Test(expected = IllegalArgumentException.class) public void assertBuildWhenCronIsNull() { JobCoreConfiguration.newBuilder("test_job", null, 3).build(); }
@Test(expected = IllegalArgumentException.class) public void assertBuildWhenTotalSHardingCountIsNegative() { JobCoreConfiguration.newBuilder(null, "0/1 * * * * ?", -1).build(); }